Overview
Contentful’s User Management API helps organizations programmatically manage their organizations, organization memberships, teams, space memberships and more.
Basic API information
API Base URL https://api.contentful.com
This is a read/write API
Authentication
A valid Content Management API token must be included for all requests documented in this section, as follows:
- In the
Authorizationheader, specifically as:Authorization: Bearer MY_ACCESS_TOKEN. - In the
access_tokenURL query parameter:?access_token=MY_ACCESS_TOKEN
For security reasons Contentful strongly recommends passing the token via the Authorization header.
Note that all permissions and access rights for API endpoints in this section are derived from the user on whose behalf the access token was generated.
Pagination
Contentful returns collections of resources in a wrapper object that contains extra information useful for paginating over large result sets.
Example Usage
Example query string:
Example response:
Request Parameters
Response Attributes
Paginated collections include a few additional top-level attributes related to pagination:
Sorting Results
You can use the order parameter when paging through larger result sets to keep ordering predictable.
Example Usage
- Results are returned in ascending order for the specified attributes(s).
- Use
-in front of the attribute to specify descending order. - Separate multiple sort attributes with a comma. Sort fields are applied in the order specified.
- Attributes are identified by their path (e.g.
sys.user.firstName). - See endpoint documentation for a list of which order attributes are supported for that endpoint.
Including Related Resources
You can use the include parameter to include linked resources in your response. This allows you to avoid making additional requests to fetch related resources.
Example Usage
As a more detailed explanation, envision the following API request and response:
Request
Response
To fetch the linked users referenced in sys.user and sys.createdBy, you would normally need to make subsequent API calls.
Using the include parameter you can request the linked users to be “included” in the response:
Request
Response
As you can see, the link objects (user and createdBy) are now fully resolved inside the includes attribute in the response, organized by type (i.e. User).
Additional Notes
- Linked resources are returned in the
includesattribute of the response body, organized by type. - Only resources related to the current result set are included in the response. For example, if you are paginating through a list of results,
includeonly includes related resources for that page (not the entire result set). - Resources to include are identified by their path in the query string.
- See endpoint documentation for a list of which include fields are supported for a given collection endpoint.
Searching Multiple Attributes
Some collection endpoints support a query parameter that performs a full-text search across multiple resource attributes.
Example Usage
- See endpoint documentation for details about which fields are searched for a given endpoint.
Filtering Results
You can use a variety of filter parameters to search and filter items in the response from collection endpoints.
Example Usage
In general the format of a filter parameter is as follows:
Operators
For each supported field, one or more operators is available. This table explains their usage: