> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bedrock.quarry-systems.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Membership

> Add a subject to a scope by creating a membership

## Request Body

<ParamField body="subjectId" type="string" required>
  The subject ID to add to the scope
</ParamField>

<ParamField body="scopeId" type="string" required>
  The scope ID to add the subject to
</ParamField>

## Response

Returns the created membership object.

<RequestExample>
  ```bash cURL theme={null}
  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"
    }'
  ```

  ```javascript Node.js theme={null}
  const axios = require('axios');

  const { data } = await axios.post('https://api.example.com/memberships', {
    subjectId: 'sub_123',
    scopeId: 'scope_456',
  }, {
    headers: { 'Authorization': 'Bearer YOUR_TOKEN' },
  });
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "mem_789",
    "subjectId": "sub_123",
    "scopeId": "scope_456"
  }
  ```
</ResponseExample>
