> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://contentful.com/developers/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://contentful.com/developers/docs/_mcp/server.

# Create a space membership

POST https://api.contentful.com/spaces/{space_id}/space_memberships
Content-Type: application/json

Creates a space membership, assigning the user as admin or to one or more roles. The user must exist in the organization and is identified by their email address.

Reference: https://contentful.com/developers/docs/references/user-management-api/space-memberships/create-a-space-membership

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `space_id` (string, required) — The space ID

### Body (application/json)

This endpoint expects a map from string to any.

- `map from string to any`

## Response

### 201

Created - Space membership created successfully

- `map from string to any`

## Examples

**Request**

```json
{
  "admin": false,
  "email": "user@example.com",
  "roles": [
    {
      "sys": {
        "id": "1ElgCn1mi1UHSBLTP2v4TD",
        "linkType": "Role",
        "type": "Link"
      }
    }
  ]
}
```

**Response**

```json
{
  "admin": false,
  "roles": [
    {
      "sys": {
        "id": "1ElgCn1mi1UHSBLTP2v4TD",
        "linkType": "Role",
        "type": "Link"
      }
    }
  ],
  "sys": {
    "createdAt": "2025-08-18T15:24:44Z",
    "id": "jn066pnp3hgr-7uqvFPPLzgtVaezGvjA9U6",
    "space": {
      "sys": {
        "id": "jn066pnp3hgr",
        "linkType": "Space",
        "type": "Link"
      }
    },
    "type": "SpaceMembership",
    "updatedAt": "2025-08-18T15:24:44Z",
    "user": {
      "sys": {
        "id": "7uqvFPPLzgtVaezGvjA9U6",
        "linkType": "User",
        "type": "Link"
      }
    },
    "version": 0
  }
}
```