Skip to main content
POST
http://localhost:3000
/
memberships
curl -X POST 'https://api.example.com/memberships' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "subjectId": "sub_123",
    "scopeId": "scope_456"
  }'
{
  "id": "mem_789",
  "subjectId": "sub_123",
  "scopeId": "scope_456"
}

Request Body

subjectId
string
required
The subject ID to add to the scope
scopeId
string
required
The scope ID to add the subject to

Response

Returns the created membership object.
curl -X POST 'https://api.example.com/memberships' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "subjectId": "sub_123",
    "scopeId": "scope_456"
  }'
{
  "id": "mem_789",
  "subjectId": "sub_123",
  "scopeId": "scope_456"
}