Skip to main content
Follow User
Creates a follow relationship from the authenticated user to the specified user. A notification is sent to the followed user. Following a user you already follow is not an error: it answers 200 with the existing follow, and no second notification is sent. Two follows sent at the same time leave one follow.
Requires the follows bundle. A project without the follows bundle returns 403 database/tables-not-available. See Bundles.

Path Parameters

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

Body Parameters

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

Response

Returns HTTP 201 with the created follow row, or HTTP 200 with the existing follow row when the follow is already there. The body is the same in both cases:
string
ID of the follow record (UUID). Pass it to Delete Follow to remove the follow.
object
Public profile of the followed user (the user in the path). Sensitive fields (email, hash, secureMetadata, etc.) are excluded.
string
ISO timestamp of when the follow 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 follow doesn’t exist, or one of the two users has blocked the other. Both get the same answer:

See Also