Content Management API

[API VERSION : 3.0.0]

Introduction

Overview

Contentstack is a headless, API-first content management system (CMS) that provides everything you need to power your web or mobile properties. To learn more about Contentstack, visit our website or refer to our documentation site to understand what we do.

This document is a detailed reference to Contentstack’s Content Management API.

The Content Management API is used to manage the content of your Contentstack account. This includes creating, updating, deleting, and fetching content of your account. To use the Content Management API, you will need to authenticate yourself with authtoken. Read more about it in Authentication.

The Content Management APIs also include many GET requests. However, it is highly recommended that you always use the Content Delivery API to deliver content to your web or mobile properties.

Authentication

In order to make any Content Management API (CMA) requests, you need to first obtain an authtoken. To retrieve this authtoken, log in to your Contentstack account by using the ‘Log in to your account’ request under ‘User Session’. This request will return the authtoken in the response body.

Once you have the authtoken, you need to pass it as a header in each Content Management API request. You can also use the received authtoken in Content Delivery API (CDA) requests where you need to input access token.

You can generate multiple authtokens by executing the ‘Log in to your account’ request multiple times. However, at any point, only the latest 20 authtokens will be valid to execute CDA and/or CMA requests.  The authtokens created before the latest 20 authtoken, and the ones that you used to log out will be invalid.

For SSO enabled organizations, the ‘Login to your account’ request will not return the user authtoken for users who access the organization through Identity Provider login credentials. Consequently, any requests that require user authtoken will not work. Only the owner of the organization and users with permission to access the organization without SSO can use the Content Management APIs. Read more.

API conventions

  • The base URL for Content Management API is api.contentstack.io.
  • The API version can be found in the URL, e.g. api.contentstack.io/v3/endpoint.
  • URL paths, URL query parameter names, and JSON field names are case sensitive.
  • URL paths use lower case.
  • Query parameters and JSON fields use lower case, with underscores (_) separating words.
  • The success/failure status of an operation is determined by the HTTP status it returns. Additional information is included in the HTTP response body.
  • The APIs return standard HTTP error code formats.
  • Unexpected query parameters are ignored.
  • Unexpected JSON fields in the request body are ignored.
  • The JSON number type is bounded to a signed 32-bit integer.

Errors

If there is something wrong with the API request, Contentstack returns an error.

Contentstack uses conventional, standard HTTP status codes for errors, and returns a JSON body containing details about the error. In general, codes in the 2xx range signify success. The codes in the 4xx range indicate error, mainly due to information provided (for example, a required parameter or field was omitted). Lastly, codes in the 5xx range mean that there is something wrong with Contentstack’s servers; it is very rare though.

Let’s look at the error code and their meanings.

HTTP status code Description
400 Bad Request The request was incorrect or corrupted.
401 Access Denied The login credentials are invalid.
403 Forbidden Error The page or resource that is being accessed is forbidden.
404 Not Found The requested page or resource could not be found.
412 Pre Condition Failed The entered API key is invalid.
422 Unprocessable Entity (also includes Validation Error and Unknown Field) The time at which the current rate limit resets.
500 Internal Server Error The server is malfunctioning and is not specific on what the problem is.
502 Bad Gateway Error A server received an invalid response from another server.
504 Gateway Timeout Error A server did not receive a timely response from another server that it was accessing while attempting to load the web page or fill another request by the browser.

Reference

Users

All accounts registered with Contentstack are known as Users. A stack can have many users with varying permissions and roles. Read Users to learn more.

Note: Before executing any calls, retrieve the authtoken by authenticating yourself via the Log in call of User Session. The authtoken is returned in the 'Response' body of the Log in call and is mandatory in all of the calls. Example: blt3cecf75b33bb2ebe

User Collection

Get user

Try

The Get user call returns comprehensive information of an existing user account. The information returned includes details of the stacks owned by and shared with the specified user account.

When executing the API call, under the 'Header' section, you need to enter user authtoken that you receive after logging into your Contentstack account.

Update user

Try

The Update User call updates the details of an existing user account. Only the information entered here will be updated, the existing data will remain unaffected.When executing the API call, under the 'Body' section, enter the information of the user that you wish to update. This information should be in JSON format.

Delete user

Try

The Delete user call deletes the current authenticated user permanently from your Contentstack account.

When executing the API call, under the 'Header' section, you need to enter the authtoken of the user whom you wish to delete.

Activate User

Activate a user account

Try

The Activate a user account call activates the account of a user after signing up. For account activation, you will require the token received in the activation email.

Request Password

Request for a password

Try

The Request for a password call sends a request for a temporary password to log in to an account in case a user has forgotten the login password.

Using this temporary password, you can log in to your account and set a new password for your Contentstack account.

In the 'Body' section, provide the user's email address in JSON format.

Reset Password

Reset password

Try

The Reset password call sends a request for resetting the password of your Contentstack account.

When executing the call, in the 'Body' section, you need to provide the token that you receive via email, your new password, and password confirmation in JSON format.

Note: Before using this call, you need to run the 'Request Password' call to receive the reset password token in your registered email address.

User Session

User session consists of calls that will help you to sign in and sign out of your Contentstack account.

Logging in/out

Log in to your account

Try

The Log in to your account all is used to sign in to your Contentstack account and obtain the authtoken.

Note: The main difference between authtoken and access token is that authtoken is a mandatory parameter when it comes to managing content via Content Management API calls, and on the contrary, access token is required only when retrieving content via Content Delivery API calls.

When executing the API call, under the 'Header' section, you need to enter user authtoken that you receive after logging into your account.

In the 'Body' section, enter the user credentials in JSON format. The JSON query will include the email address, the Contentstack user account password, and the two-factor authentication token (if enabled) received in the Authy app or SMS.

Log out of your account

Try

The Log out of your account call is used to sign out the user of Contentstack account.

When executing the API call, under the 'Header' section, you need to enter user authtoken that you receive after logging into your account.

Organizations

Organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users. Organization allows easy management of projects as well as users within the Organization.

Read more about Organizations.

Organizations Collection

Get all organizations

Try

The Get all organizations call lists all organizations related to the system user in the order that they were created.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Get a single organization

Try

The Get a single organization call gets the comprehensive details of a specific organization related to the system user.

When executing the API call, provide the organization uid. In the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Organization Roles

Get all roles in an organization

Try

The Get all roles in an organization call gives the details of all the roles that are set to users in an organization.

When executing the API call, provide the organization uid. In the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Organization Users

Add users to organization

Try

The Add users to organization call allows you to send invitations to add users to your organization. Only the owner or the admin of the organization can add users.

When executing the API call, provide the organization uid. In the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Resend pending organization invitation

Try

The Resend pending organization invitation call allows you to resend organization invitations to users who have not yet accepted the earlier invitation. Only the owner or the admin of the organization can resend the invitation to add users to an organization.

When executing the API call, provide the organization uid. In the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Get all organization invitations

Try

The Get all organization invitations call gives you a list of all the organization invitations. Only the owner or the admin of the organization can resend the invitation to add users to an organization.

When executing the API call, provide the organization uid. In the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Transfer Organization Ownership

Transfer organization ownership

Try

The Transfer organization ownership call transfers the ownership of an organization to another user. When the call is executed, an email invitation for accepting the ownership of a particular organization is sent to the specified user.

Once the specified user accepts the invitation by clicking on the link provided in the email, the ownership of the organization gets transferred to the new user. Subsequently, the previous owner will no longer have any permission on the organization.

When executing the API call, provide the organization uid. In the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Organization Stacks

Get all stacks in an organization

Try

The Get all stacks in an organization call fetches the list of all stacks in an organization.

When executing the API call, provide the organization uid. In the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Stacks

A stack is a space that stores the content of a project (a web or mobile property). Within a stack, you can create content structures, content entries, users, etc. related to the project. Read more about Stacks.

Stack Collection

Get all stacks

Try

The Get all stacks call fetches the list of all stacks owned by and shared with a particular user account.

Note that you can also retrieve only a particular stack using this call by passing the API Key and Access Token of the stack in the header.

Create stack

Try

The Create stack call creates a new stack in your Contentstack account.

When executing the API call, in the 'Header' section, enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, provide the schema of the stack in JSON format.

Update stack

Try

The Update stack call lets you update the name and description of an existing stack.

When executing the API call, in the 'Header' section, enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, provide the updated schema of the stack in JSON format.

Please note that the master locale cannot be changed once it is set while stack creation. So, you cannot use this call to change/update the master language.

Delete stack

Try

The Delete stack call is used to delete an existing stack permanently from your Contentstack account.

Get all users

Get all users of a stack

Try

The Get all users of a stack call fetches the list of all users of a particular stack

Transfer Stack Ownership

Transfer stack ownership to other users

Try

The Transfer stack ownership to other users call sends the specified user an email invitation for accepting the ownership of a particular stack.

Once the specified user accepts the invitation by clicking on the link provided in the email, the ownership of the stack gets transferred to the new user. Subsequently, the previous owner will no longer have any permission on the stack.

When executing the API call, in the 'Header' section, enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, you need to provide the email address of the user to whom you wish to transfer the ownership of the stack in JSON format.

Accept Stack Ownership

Accept stack owned by other user

Try

The Accept stack owned by other user call allows a user to accept the ownership of a particular stack via an email invitation.

The email invitation includes a link (i.e., /stack/accept_ownership/{ownership_token}?{api_key}&{user_uid} ) that consists of the ownership token, the API key, and user uid.

Once the user accepts the invitation by clicking on the link, the ownership is transferred to the new user account. Subsequently, the user who transferred the stack will no longer have any permission on the stack.

When executing the API call, in the 'URI Parameters' section, you need to provide the ownership token and the user uid that you received in the invitation mail.

Stack Settings

Get stack settings

Try

The Get stack settings call retrieves the configuration settings of an existing stack.

When executing the API call, in the 'Header' section, you need to provide the API key of your stack and the authtoken that you receive after logging into your account.

Add stack settings

Try

The Add stack settings call lets you add settings for an existing stack.

When executing the API call, in the 'Header' section, you need to provide the API key of your stack and the authtoken that you receive after logging into your account.

Reset stack settings

Try

The Reset stack settings call resets your stack to default settings, and additionally, lets you add parameters to or modify the settings of an existing stack.

When executing the API call, in the 'Header' section, you need to provide the API key of your stack and the authtoken that you receive after logging into your account.

Share Stack

Share a stack

Try

The Share a stack call shares a stack with the specified user to collaborate on the stack.

When executing the API call, in the 'Header' section, you need to provide the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, you need to provide the email ID of the user with whom you wish to share the stack along with the role uid that you wish to assign the user.

Unshare Stack

Unshare a stack

Try

The Unshare a stack call unshares a stack with a user and removes the user account from the list of collaborators. Once this call is executed, the user will not be able to view the stack in their account.

When executing the API call, in the 'Header' section, you need to provide the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, you need to provide the email ID of the user from whom you wish to unshare the stack.

Content Types

Content type defines the structure or schema of a page or a section of your web or mobile property. To create content for your application, you are required to first create a content type, and then create entries using the content type. Read more about Content Types.

Content Type Collection

Get all content types

Try

The Get all content types call returns comprehensive information of all the content types available in a particular stack in your account.

When executing the API call, you can add queries to extend the functionality of this API call. Under the 'URI Parameters' section, insert a parameter named query and provide a query in JSON format as the value. (To learn more about the queries, refer to the Queries section of the Content Delivery API doc.)

In the 'Header' section, you need to provide the API key of your stack and the authtoken that you receive after logging into your account.

Get a single content type

Try

The Get content type call returns information of a specific content type.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

The response contains the content type schema and other details, but does not include its entries.

Create a content type

Try

The Create a content type call creates a new content type in a particular stack of your Contentstack account.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

In the 'Body' section, you need to provide the complete schema of the content type. You can refer the JSON schema for creating a content type document to know how you can add fields into your content type through API.

Update Content Type

Try

The Update Content Type call is used to update the schema of an existing content type.

When executing the API call, in the 'URI Parameters' section, provide the uid of your content type.

In the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

In the 'Body' section, you need to provide the updated schema of your content type. You can refer the JSON schema for creating a content type document to know how you can add/update fields in your content type through API.

Delete Content Type

Try

The Delete Content Type call deletes an existing content type and all the entries within it.

When executing the API call, in the 'URI Parameters' section, provide the uid of your content type.

In the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Content Type References

Get all referenced content types

Try

This call will display all the content types that are referenced within a specific content type.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Export Content Type

Export a content type

Try

This call is used to export a specific content type and its schema. The data is exported in JSON format.

However, please note that the entries of the specified content type are not exported through this call.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Import Content Type

Import a content type

Try

This call imports a content type into a stack. To import, you need to provide/upload a JSON file that contains the schema of the content type that you wish to import.

Note: Currently, the console doesn't give you the provision to select a file manually from your local system. You can try the call manually in any REST API client, such as Postman, by passing a 'Body' parameter named content_type and selecting the input type as 'File'. Then, select the JSON file of the content type that you wish to import.

Entries

An entry is the actual piece of content created using one of the defined content types. Read more about Entries.

Entry Collection

Get all entries

Try

The Get all entries call fetches the list of all the entries of a particular content type. It also returns the content of each entry in JSON format. You can also specify the environment and locale of which you wish to get the entries.

You can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.

To learn more about the queries, refer to the Queries section of the Content Delivery API doc.

Get a single entry

Try

The Get a single entry call fetches a particular entry of a content type.

The content of the entry is returned in JSON format. You can also specify the environment and locale of which you wish to retrieve the entries.

Create an entry

Try

The Create an entry call creates a new entry for the selected content type.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

In the 'Body' section, you need to provide the content of your entry based on the content type created.

Update an entry

Try

The Update an entry call lets you update the content of an existing entry.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

In the 'Body' section, you need to provide the updated content of your entry.

Delete an entry

Try

The Delete an entry call is used to delete a specific entry from a content type.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Entry Languages

Get languages of an entry

Try

This call returns the details of all the languages that an entry exists in.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Unlocalization

Unlocalize an entry

Try

This call is used to unlocalize an existing entry. Read more about Unlocalization.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Export Entry

Export an entry

Try

This call is used to export an entry. The exported entry data is saved in a downloadable JSON file.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Import Entry

The calls given below help you to import entries by uploading JSON files.

Note: Currently, the console doesn't give you the provision to select a file manually from your local system. You can try the call manually in any REST API client, such as Postman, by passing a 'Body' parameter named entry and select the input type as 'File'. Then, select the JSON file of the entry that you wish to import.

Import an entry

Try

This call is used to import an entry. To import an entry, you need to upload a JSON file that has entry data in the format that fits the schema of the content type it is being imported to.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Import an existing entry

Try

This call will import a new version of an existing entry. You can create multiple versions of an entry.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

Publish Entry

Publish an entry

Try

This call lets you publish an entry either immediately or schedule for a later date/time.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

In the 'Body' section, you can specify the locales and environments to which you want to publish the entry. These details should be specified in the ‘entry’ parameter. However, if you do not specify a source locale, it will be published in the master locale automatically.

You also need to mention the master locale and the version number of your entry that you want to publish.

In case of Scheduled Publishing, add the scheduled_at key and provide the date/time in the ISO format as its value. Example: "scheduled_at":"2016-10-07T12:34:36.000Z"

Unpublish Entry

Unpublish an entry

Try

This call will unpublish an entry at once, and also, gives you the provision to unpublish an entry automatically at a later date/time.

When executing the API call, in the 'Header' section, you need to provide the authtoken that you receive after logging into your account.

In the 'Body' section, you can specify the locales and environments from which you want to unpublish the entry. These details should be specified in the ‘entry’ parameter. However, if you do not specify a locale, it will be unpublished from the master locale automatically.

You also need to mention the master locale and the version number of your entry that you want to publish.

In case of Scheduled Unpublishing, add the scheduled_at key and provide the date/time in the ISO format as its value. Example: "scheduled_at":"2016-10-07T12:34:36.000Z"

Assets

Assets refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded in your Contentstack repository for future use. 

These files can be attached and used in multiple entries. Read more about Assets.

Asset Collection

Get all assets

Try

The Get all assets call returns comprehensive information on all assets available in a stack.

You can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.

To learn more about the queries, refer to the Queries section of the Content Delivery API doc.

Get an asset

Try

The Get an asset call returns comprehensive information about a specific version of an asset of a stack.

Upload asset

Try

The Upload asset call uploads a file to your stack.

Note: Currently, the console doesn't give you the provision to select a file manually from your local system. You can try the call manually in any REST API client, such as Postman. Pass a 'Body' parameter named asset[upload] and select the input type as 'File'. Then, select a file that you wish to import. You can also pass optional parameters asset[title] and asset[description]. The asset[title] parameter lets you enter a title for the uploaded asset, and the asset[description] parameter lets you enter a description for the uploaded asset.

Replace asset

Try

The Replace asset call will replace an existing asset with another file on the stack.

Note: Currently, the console doesn't give you the provision to select a file manually from your local system. You can try the call manually in any REST API client, such as Postman, by passing a 'Body' parameter named asset[upload] and select the input type as 'File'. Then, select a file that you wish to import.

Delete asset

Try

The Delete asset call will delete an existing asset from the stack.

Rich Text Editor Assets

Get information on RTE assets

Try

The Get information on RTE assets call returns comprehensive information on all assets uploaded through the Rich Text Editor field.

Retrieve Specific Asset Types

Get either only images or videos

Try

The Get either only images or videos call retrieves assets that are either image or video files, based on query request.

You can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.

To learn more about the queries, refer to the Queries section of the Content Delivery API doc.

Update Asset Details

Update asset revision

Try

The Update asset revision call upgrades a specified version of an asset as the latest version of that asset.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

In the 'Body' section, enter the asset details, such as locales and environments, where the assets need to be published. You need to specify the asset version number that you wish to make the latest. These details should be in JSON format.

Update asset title and description

Try

The Update asset title and description call updates the title and description of an asset.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

In the 'Body' section, enter the asset details, such as locales and environments, where the assets need to be published. You need to specify the new title and description for the asset. These details should be in JSON format.

Publish Asset

Publish an asset

Try

The Publish an asset call is used to publish a specific version of an asset on the desired environment either immediately or at a later date/time.

In case of Scheduled Publishing, add the scheduled_at key and provide the date/time in the ISO format as its value. Example: "scheduled_at":"2016-10-07T12:34:36.000Z"

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

In the 'Body' section, enter the asset details, such as locales and environments, where the assets need to be published. These details should be in JSON format.

Unpublish Asset

Unpublish an asset

Try

The Unpublish an asset call is used to unpublish a specific version of an asset from a desired environment.

In case of Scheduled Unpublishing, add the scheduled_at key and provide the date/time in the ISO format as its value. Example: "scheduled_at":"2016-10-07T12:34:36.000Z"

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

In the 'Body' section, enter the asset details, such as locales and environments, from where the assets need to be unpublished. These details should be in JSON format.

Labels

Labels allow you to group a collection of content within a stack. Using labels you can group content types that need to work together. Read more about Labels.

Labels Collection

Get all labels

Try

This call fetches all the existing labels of the stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

You can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.

To learn more about the queries, refer to the Queries section of the Content Delivery API doc.

Get a single label

Try

The Get label call returns information about a particular label of a stack.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

Add label

Try

This call is used to create a label.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, enter the label details, such as the name of the label, the uid of the parent label, and the content types that need to be included in the label. These details need to be provided in JSON format.

Update label

Try

The Update label call is used to update an existing label.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

In the 'Body' section, enter the updated details of your label, which include the name of the label, the uid of the parent label, and the content types that need to be included in the label. These details need to be provided in JSON format.

Delete label

Try

The Delete label call is used to delete a specific label.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

Languages

Contentstack has a sophisticated multilingual capability. It allows you to create and publish entries in any language. This feature allows you to set up multilingual websites and cater to a wide variety of audience by serving content in their local language(s).

Read more about Languages.

Language Collection

Get all languages

Try

This call fetches the list of all languages (along with the language codes) available for a stack.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

You can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.

To learn more about the queries, refer to the Queries section of the Content Delivery API doc.

Add a language

Try

This call lets you add a new language to your stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, enter the language codes in JSON format.

Get a language

Try

The Get a language call returns information about a specific language available on the stack.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

Update language

Try

The Update language call will let you update the details (such as display name) of an existing language of your stack.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

In the 'Body' section, enter the updated details of your language in JSON format, for example you can update the display name of the language.

Delete language

Try

The Delete language call deletes an existing language from your stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

Environment

A publishing environment corresponds to one or more deployment servers or a content delivery destination where the entries need to be published.

Read more about Environments.

Environment Collection

Get all environments

Try

The Get all environments call fetches the list of all environments available in a stack.

You can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.

To learn more about the queries, refer to the Queries section of the Content Delivery API doc.

Get a single environment

Try

The Get a single environment call returns more details about the specified environment of a stack.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

Add an environment

Try

The Add an environment call will add a publishing environment for a stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, mention the environment name, server names that are part of the environment, the urls (which include the language code and the URL of the server), and the option to deploy content to a server.

Update environment

Try

The Update environment call will update the details of an existing publishing environment for a stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, enter the updated details of the environment. You can modify the environment name, server names that are part of the environment, the urls (which include the language code and the URL of the server), and the option to deploy content to a server.

Delete environment

Try

The Delete environment call will delete an existing publishing environment from your stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

Roles

A role is a collection of permissions that will be applicable to all the users who are assigned this role.

Read more about Roles.

Role Collection

Get all roles

Try

This call returns comprehensive information about all roles created in a stack.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

You can add queries to extend the functionality of this API call. Under the URI Parameters section, insert a parameter named query and provide a query in JSON format as the value.

To learn more about the queries, refer to the Queries section of the Content Delivery API doc.

Get role

Try

The Get role call returns comprehensive information on a specific role.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

Create a role

Try

This call creates a new role in a stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, mention the role name, description, users, additional roles, and permissions (which include the details of the content types, environments, and languages that are accessible).

Update role

Try

The Update role call lets you modify an existing role of your stack. However, the pre-existing system roles cannot be modified.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, include the updated details of the role which include name, description, users, additional roles, and permissions (which include the details of the content types, environments, and languages that are accessible).

Delete role

Try

The Delete role call deletes an existing role from your stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

Webhooks

A webhook is a mechanism that sends real-time information to any third-party app or service to keep your application in sync with your Contentstack account. Webhooks allow you to specify a URL to which you would like Contentstack to post data when an event happens. Read more about Webhooks.

Webhook Collection

Get all webhooks

Try

This call returns comprehensive information on all the available webhooks in the specified stack.

Note: Execute this call when you wish to retrieve the uid of a webhook.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

Get webhook

Try

The Get a webhookcall returns comprehensive information on a specific webhook.

When executing the API call, under the 'Header' section, you need to enter the authtoken that you receive after logging into your account.

Create a webhook

Try

This call creates a new webhook in the specified stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, enter the name of the webhook; the destination details such as target urls, basic authentication details, and custom headers; channels; and set the retry policy.

Update webhook

Try

The Update a webhook call will update the details of an existing webhook in a stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

In the 'Body' section, you can enter the updated details of the name of the webhook; the destination details such as target urls, basic authentication details, and custom headers; channels; and set the retry policy.

Delete webhook

Try

The Delete webhook call deletes an existing webhook from a stack.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

Get Webhook Executions

Get executions of webhooks

Try

This call will provide the execution details of a specific webhook including the execution_uid, which is instrumental in retrieving the webhook logs and when retrying a webhook.

When executing the API call, under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

Webhook Retry

Retry a webhook

Try

This call makes a manual attempt to execute a webhook after the webhook has finished executing its automatic attempts.

When executing the API call, in the 'URI Parameter' section, enter the execution_uid that you receive when you execute the 'Get executions of webhooks' call.

Under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

Get Execution Log

Get latest execution log of webhooks

Try

This call will return a comprehensive detail of all the webhooks that were executed at a particular execution cycle.

When executing the API call, in the 'URI Parameter' section, enter the execution_uid that you receive when you execute the 'Get executions of webhooks' call.

Under the 'Header' section, you need to enter the API key of your stack and the authtoken that you receive after logging into your account.

top arrow