---
title: "Users"
description: "<p>Invite users to a space and manage their roles.</p>"
url: "https://www.contentstack.com/docs/developers/apis/assets-api/users"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-08-21"
---

# Users

Invite users to a space and manage their roles.

## Invite users to a space

### Invite users to a space

**POST** `/api/spaces/{space_uid}/users`

The Invite users to a space request invites one or more users to the specified space and assigns them roles. You can include an optional message with the invitation.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "notice": "string"
}
```

## Get space users

### Get space users

**GET** `/api/spaces/{space_uid}/users`

The Get space users request fetches a paginated list of all users who have access to the specified space.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.

#### Query Parameters

- **skip** (optional)
  The skip parameter skips a specific number of items in the output. For example, if there are 20 items and you want to skip the first 2 to get only the last 18 in the response body, specify 2 here.
- **limit** (optional)
  The limit parameter returns a specific number of items (between 0 and 100) in your response based on the value you provide.
- **include_count** (optional)
  Set to true to include the total number of users in the response. Default is false.
- **include_roles** (optional)
  Set to true to include the roles of each user in the response. Default is false.
- **sort** (optional)
  Enter the field name to sort the users by.
- **order** (optional)
  Enter the sort order of the results. Accepted values are asc for ascending and desc for descending.
- **search_text** (optional)
  Enter the text to search for across the users in the space.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "users": [
    {}
  ],
  "count": 0
}
```

## Update user roles

### Update user roles

**PUT** `/api/spaces/{space_uid}/users/{user_uid}/roles`

The Update user roles request updates the roles assigned to a specific user within the space.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.
- **user_uid** (required)
  Enter the uid of the user that you want to manage.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "notice": "string"
}
```

## Remove a user from a space

### Remove a user from a space

**DELETE** `/api/spaces/{space_uid}/users/{user_uid}`

The Remove a user from a space request revokes a specific user's access to the space.

#### URL Parameters

- **space_uid** (required)
  Enter the uid of the space that you want to retrieve.
- **user_uid** (required)
  Enter the uid of the user that you want to manage.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer <token>. This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.

#### Sample Response

```json
{
  "notice": "string"
}
```