Skip to main content
Block User
Creates a block edge from the acting user (the blocker) to the specified user (the target). Blocking is non-disclosing — the blocked user is never notified and can never tell they’ve been blocked. On a new block, Sublay retroactively tears down the existing relationship between the two users in one transaction: any follow in either direction is removed, and any connection or pending connection request in either direction is removed. Nothing is restored on unblock. See Block enforcement for the full list of what a block prevents and hides.
Requires the moderation bundle. Blocking ships with reporting and suspensions as part of the trust & safety package. A project without the moderation bundle returns 403 database/tables-not-available. See Bundles.

Path Parameters

string
required
The Sublay user ID (UUID) of the user to block (the target).

Body Parameters

string
Service key only, and required with one: the user this request acts as, who performs the block (the blocker). A user token always acts as its own user and must not send it (400 block/acting-user-not-allowed).

Response

On a new block, returns HTTP 201 with the created block row. Re-blocking an already-blocked user is an idempotent success and returns HTTP 200 with the existing row.
string
ID of the block record (UUID).
object
Public profile of the blocked user (the user in the path). Sensitive fields (email, hash, secureMetadata, etc.) are excluded.
string
ISO timestamp of when the block was created.

Error Responses

A service key sent no actingUserId.
A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
A service key named an actingUserId that isn’t a user in this project:
Otherwise, the user to block doesn’t exist:

See Also