Skip to content

Get your relationship with a user

GET
/users/{ref}/relationship

Returns how you and the account ref are connected: whether each of you follows the other, and whether each of you has blocked the other.

You need to be signed in; no capability is needed. Without a session cookie or bearer token that identifies you, the answer is 401, whether or not public mode is on; there is no answer for visitors. A ref that isn’t a whole number gets a plain-text 400 before sign-in is checked, and a ref with no account gets 404. For your own ref, is_self is true and the other four are false.

Both directions are shown to both people: if someone has blocked you, is_blocked_by_them tells you so. The account’s status isn’t checked.

The two follow flags can come from a cache on each server, while the two block flags are read fresh, and the four are read one after another rather than together. So an answer can mix older and newer state, for example right after a follow, an unfollow or a block, or when this server hasn’t caught up with a change. Server errors get a plain-text 500.

ref
required
integer format: int64

The account’s ref.

How you and the account are connected.

How you and another account are connected. For your own account only is_self is true.

object
is_self
required

true when the account is your own; the other four are then false.

boolean
is_following
required

true when you follow the account.

boolean
is_followed_by
required

true when the account follows you.

boolean
is_blocked_by_me
required

true when you have blocked the account.

boolean
is_blocked_by_them
required

true when the account has blocked you.

boolean

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}

Resource not found

object
error
required

Human-readable error summary

string
Example
the request could not be completed