# Relationship

Schemas

Follow relationship between two accounts: whether the first follows the second, and whether it is followed back.

## Endpoints

1 endpoint returns relationships on X.

- [GETX (Twitter) Friendship API`/v1/x/friendship`](https://socialtap.dev/docs/reference/x/friendship/index.md)

## Schema

Every endpoint above returns this object as `data`. The standard [`meta`](https://socialtap.dev/docs/reference/index.md#meta) comes with every response.

| Field | Type | Description |
| --- | --- | --- |
| `platform` | `string` | Platform ID (x, …). |
| `source` | `object` | The account whose follow is checked (the handle param): is_following says whether it follows target. At least its id or username. |
| `source.id` | `string` or `null` | Platform-native account ID; null when only the handle is known. |
| `source.username` | `string` or `null` | Handle without the @; null when the account has none. |
| `source.display_name` | `string` or `null` | Display name shown on the profile. |
| `source.url` | `string` (uri) or `null` | Canonical profile URL. |
| `source.avatar_url` | `string` (uri) or `null` | Profile picture URL. Platform CDN URLs can expire within hours. |
| `source.is_verified` | `boolean` or `null` | Platform verification badge; null where the platform has no badge. |
| `target` | `object` | The other account (the target param): is_followed_by says whether it follows source. At least its id or username. |
| `target.id` | `string` or `null` | Platform-native account ID; null when only the handle is known. |
| `target.username` | `string` or `null` | Handle without the @; null when the account has none. |
| `target.display_name` | `string` or `null` | Display name shown on the profile. |
| `target.url` | `string` (uri) or `null` | Canonical profile URL. |
| `target.avatar_url` | `string` (uri) or `null` | Profile picture URL. Platform CDN URLs can expire within hours. |
| `target.is_verified` | `boolean` or `null` | Platform verification badge; null where the platform has no badge. |
| `is_following` | `boolean` or `null` | True when source follows target, false when it does not; null when the platform did not say. |
| `is_followed_by` | `boolean` or `null` | True when target follows source, false when it does not; null when the platform did not say. Both true: they follow each other. |
| `platform_specific` | `object` | Fields only this platform has, under its ID (platform_specific.\<platform>); each null when unknown. |
| `platform_specific.x` | `object` or `null` | An X relationship's own fields: whether source can send target a direct message. |
| `platform_specific.x.is_messageable` | `boolean` or `null` | True when X would let source send target a direct message (target follows source, or accepts messages from anyone), false when it would not; null when X did not say. |

## Item errors

Besides the [request-level errors](https://socialtap.dev/docs/errors/index.md) every endpoint can return, relationship endpoints return:

| Code | HTTP | Retry | Meaning | What to do |
| --- | --- | --- | --- | --- |
| `not_found` | 404 | No | The item does not exist or was deleted. On GET /v1/requests/{id}/response: the response was not kept (details.reason says why). | Check the link or ID. Do not retry. |
| `private_or_unavailable` | 403 | No | The item exists but is not public: it is private, age- or region-restricted, or needs a login to view. It shares 403 with forbidden (which is about the key), so branch on the code. | Only public items can be fetched. Do not retry. |

---

[HTML version](https://socialtap.dev/resources/relationship/) · [Docs index for AI agents](https://socialtap.dev/llms.txt) · [All docs in one file](https://socialtap.dev/llms-full.txt)
