Skip to main content
GET
/
users
/
@me
/
relationships
List relationships
curl --request GET \
  --url https://api.example.com/users/@me/relationships \
  --header 'Authorization: <authorization>'
{
  "401": {},
  "relationships": [
    {
      "requester": {
        "id": "<string>",
        "username": "<string>",
        "status": 123
      },
      "requestee": {
        "id": "<string>",
        "username": "<string>",
        "status": 123
      },
      "status": "<string>"
    }
  ]
}
Retrieves all relationships for the authenticated user, including both accepted friendships and pending friend requests.

Authorization

Authorization
string
required
JWT token for authentication. Must be provided in the format: Bearer <token>

Response

Returns an array of relationship objects.
relationships
SafeRelationship[]
Array of relationship objects

Error codes

401
Unauthorized
Authorization token was not provided or is invalid.
{
  "message": "Unauthorized"
}

Example request

curl -X GET "http://localhost:8080/users/@me/relationships" \
  -H "Authorization: Bearer your-jwt-token"

Example response

[
  {
    "requester": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "username": "alice",
      "status": 1
    },
    "requestee": {
      "id": "123e4567-e89b-12d3-a456-426614174001",
      "username": "bob",
      "status": 2
    },
    "status": "ACCEPTED"
  },
  {
    "requester": {
      "id": "123e4567-e89b-12d3-a456-426614174002",
      "username": "charlie",
      "status": 0
    },
    "requestee": {
      "id": "123e4567-e89b-12d3-a456-426614174001",
      "username": "bob",
      "status": 2
    },
    "status": "PENDING"
  }
]

Build docs developers (and LLMs) love