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

To make any Content Management API (CMA) requests, you need to first obtain an Authentication token (authtoken) and then pass it as a header in each Content Management API request. An authtoken contains information that web APIs use to validate a user and to ensure that the user has the required permissions to perform the actions that they are requesting. 

To retrieve the 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.

You can generate multiple authtokens by executing the ‘Log in to your account’ request multiple times. These tokens do not have an expiration time limit. However, currently, there is a maximum limit of 20 valid tokens that a user can use per account at a time, to execute CMA requests. If you already have valid 20 tokens, creating a new authtoken will automatically cause the oldest authtoken to expire without warning.

For SSO-enabled organizations, the ‘Log in 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.

In Content Delivery API (CDA), you use the delivery token, which is a read-only token, to only fetch content and not edit or create new content. However, you can use the CMA-generated authtoken in CDA requests too, instead of the access token, and it will work exactly in the same manner. Learn more.


Rate limiting

Rate limit is the maximum number of requests you can make using Contentstack’s API in a given period. For Content Management API requests, we have set a maximum limit of 10 requests per second per organization.

To get the current rate limit status, you can check the returned HTTP headers of any API request. These rate limits are reset at the start of each time period.

Headers Description
X-RateLimit-Limit The maximum number of request a client is allowed to make per second per organization.
X-RateLimit-Remaining The number of requests remaining in the current time period.

Note: Your application will receive HTTP 429 response code if the requests for a given time period exceed the defined rate limits.

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.
429 Rate Limit Exceeded The number of requests exceeds the allowed limit for the given time period. 
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.

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.

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.

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.

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.

Get a single organization

Try

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

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's UID.

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.

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.

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.

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.

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.

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 use this call to also retrieve only a particular stack by passing the API Key and Access Token of that specific stack in the header.

Create stack

Try

The Create stack call creates a new stack in your Contentstack 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.

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

Note: 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.

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={api_key}&uid={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.

Add stack settings

Try

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

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.

Share Stack

Share a stack

Try

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

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.

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.)

Get a single content type

Try

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

Note: The schema of the content type returned will depend on the provided version. If no version is specified, you will get the latest version of the content type.

Create a content type

Try

The Create a content type call creates a new content type in a particular stack of your Contentstack 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.

To mark a field as non-unique, you need to set the unique parameter to false. For example, to remove the unique constraint on the default 'title' field, you need to update the JSON schema of the title field as follows:

{
    "display_name": "Title",
    "uid": "title",
    "data_type": "text",
    "mandatory": true,
    "unique": false,
    "field_metadata": {
      "_default": true
    },
    "multiple": false
}

Update Content Type

Try

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

Note: Whenever you update a content type, it will auto-increment the content type version.

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

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.

Content Type References

Get all referenced content types

Try

The Get all referenced content types call will fetch all the content types in which the current content type is referenced.

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.

The schema of the content type returned will depend on the version number provided.

Import Content Type

Import a content type

Try

The Import a content type 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: 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.

Note: To include the publish details in the response, make use of the include_publish_details parameter and set its value to ‘true’. This query will return the publish details of the entry in every environment along with the version number that is published in each of the environment.

Get a single entry

Try

The Get a single entry request 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.

Note: To include the publish details in the response, make use of the include_publish_details parameter and set its value to ‘true’. This query will return the publish details of the entry in every environment along with the version number that is published in each of the environment.

Also, if no version is mentioned, this request will retrieve the latest published version of the entry. To retrieve a specific version, make use of the version parameter.

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 'Body' section, you need to provide the content of your entry based on the content type created.

If you need to create an entry that contains an asset file, you need to provide the asset UID(s) in the ‘Body’ section. If you want to add only one file, enter a single UID (file_single_uid in the below code). For multiple asset files, enter the asset files’ UIDs (file_field_uid_multiple in the below code) in an array.

The JSON schema should be as follows:

{
    "entry": {
        "title": "<<title>>",
        "url": "<<url>>",
        "file_field_uid": "<<asset_uid>>",    // Simple ‘File’ field
        "file_field_uid_multiple": ["<<asset_uid1>>", "<<asset_uid2, ...>>"],
                        // ‘File’ field marked ‘Multiple’
    }
}

If you want to add your asset file within a Rich Text Editor, use the following JSON schema:

{
    "entry": {
        "title": "<<title>>",
        "url": "<<url>>",
        "rte_uid": "<p><img src=\"asset_URL" data-sys-asset-uid=\"asset_UID\" alt=\"Alternative_Text"></p>",
    "tags": []
    }
}

Update an entry

Try

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

Passing the locale parameter will cause the entry to be localized in the specified locale.

Delete an entry

Try

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

Entry References

Get references of an entry

Try

The Get references of an entry call returns all the entries of content types that are referenced by a particular entry.

Entry Languages

Get languages of an entry

Try

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

Unlocalization

Unlocalize an entry

Try

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

Export Entry

Export an entry

Try

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

Import Entry

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

Note: 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

The Import an entry 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.

Import an existing entry

Try

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

Publish Entry

Publish an entry

Try

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

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

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

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.

Note: To include the publish details in the response, make use of the include_publish_details parameter and set its value to ‘true’. This query will return the publish details of the entry in every environment along with the version number that is published in each of the environment.

Get an asset

Try

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

Note: To include the publish details in the response, make use of the include_publish_details parameter and set its value to ‘true’. This query will return the publish details of the entry in every environment along with the version number that is published in each of the environment.

Upload asset

Try

The Upload asset call uploads a file to your stack.

Note: You can try the call manually in any REST API client, such as Postman.
Under 'Body', pass a body parameter named asset[upload] and select the input type as 'File'. This will enable you to select the file that you wish to import.
You can assign a parent folder to your asset by using the asset[parent_uid] parameter, where you can pass the UID of the parent folder.
Additionally, you can pass optional parameters such as asset[title] and asset[description] which let you enter a title and a description for the uploaded asset, respectively.

Replace asset

Try

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

Note: You can try the call manually in any REST API client, such as Postman.
Under 'Body', pass a body parameter named asset[upload] and select the input type as 'File'. This will enable you to select the file that you wish to import.
You can assign a parent folder to your asset by using the asset[parent_uid] parameter, where you can pass the UID of the parent folder.
Additionally, you can pass optional parameters such as asset[title] and asset[description] which let you enter a title and a description for the uploaded asset, respectively.

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.

Asset Reference

Get asset references

Try

The Get asset references call returns the details of the entries and the content types in which the specified asset is referenced.

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.

Note: You can try the call manually in any REST API client, such as Postman. Under 'Body', you can assign a parent folder to your asset by using the asset[parent_uid] parameter where you can pass the UID of the parent folder. Additionally, you can pass optional parameters such as asset[title] and asset[description] which lets you enter a title and a description for the uploaded asset, respectively.

Update asset

Try

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

You can try the call manually in any REST API client, such as Postman. Under 'Body', pass optional parameters such as asset[title] and asset[description] to enter new title and description for the uploaded asset, respectively. These details are to be passed as form-data.

An alternative way to pass the updated details of title and description is in the form of 'raw' data, shown as follows:

{
   "asset":{
      "title":"new title",
       "description":"updated description"
     }
}

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"

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"

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.

Asset Folder Collection

Get a single folder

Try

The Get a single folder call gets the comprehensive details of a specific asset folder.

When executing the API call, you can provide the parent folder UID.

Create a folder

Try

The Create a folder call is used to create an asset folder and/or add a parent folder to it (if required).

When executing the API request, provide the parent folder UID.

In the ‘Body’ section, you need to provide a name for the new folder, and if you wish to place this folder within another folder, provide the UID of the parent folder.

Update or move folder

Try

The Update or move folder request can be used either to update the details of a folder or set the parent folder if you want to move a folder under another folder.

When executing the API request, provide the UID of the folder that you want to move/update.

In the ‘Body’ section, you need to provide a new name for your folder, and if you want to move your folder within another folder, then you need provide the UID of the parent folder.

Note: Here are some points that needs to be considered when executing this API request:

  • A maximum of 300 folders can be created.
  • The maximum level of folder nesting is 5.
  • When nesting folder, you cannot nest a folder within the same folder or within its child folders.

Delete a folder

Try

The Delete a folder call is used to delete an asset folder along with all the assets within that folder.

When executing the API call, provide the parent folder UID.

Extensions

Extensions let you create custom fields and custom widgets that lets you customize Contentstack's default UI and behavior. Read more about Extensions.

Custom Fields

This type of extension lets you create custom fields that you can use in your content types. Read more.

Get all custom fields

Try

The Get all custom fields request is used to get the information of all custom fields created in a stack.

Get a single custom field

Try

The Get a single custom field request gets the comprehensive details of a specific custom field.

Upload a custom field

Try

The Upload a custom field request is used to upload a custom field to Contentstack.

In the ‘Body’ section, you need to provide the following ‘Body’ parameters under ‘form-data’:

  • extension[upload]: Select the HTML file of the custom field that you want to upload
  • extension[title]: Enter the title of the custom field that you want to upload
  • extension[data_type]: Enter the data type for the input field of the custom field
  • extension[tags]: Enter the tags that you want to assign to the custom field
  • extension[multiple]: Enter ‘true’ if you want your custom field to store multiple values
  • extension[type]: Enter type as ‘field’, since this is a custom field extension.

Note: You can try the call manually in any REST API client, such as Postman. Under 'Body', for the extension[upload] parameter, select the input type as 'File'. This will enable you to select the file that you wish to import.

Create a custom field with source URL

Try

The Create a custom field with source URL call is used to create a custom field that is hosted externally.

In the ‘Body’ section, you need to provide details of the custom field, such as its tags, data type, title, external source link, set if the field is to take multiple values or not, and configuration details.

Create a custom field with source code

Try

The Create a custom field with source code request is used to create a custom field in Contentstack by providing the source code of the extensions. This source code will be hosted on Contentstack.

In the ‘Body’ section, you need to provide details of the custom field, such as its tags, data type, title, source code of the extension, set if the field is to take multiple values or not, and configuration details.

Update a custom field

Try

The Update a custom field request is used to update the details of a custom field.

In the ‘Body’ section, you need to provide details of the custom field, such as its tags, data type, title, external source link (or the updated external source code), set if the field is to take multiple values or not, and configuration details.

Delete custom field

Try

The Delete custom field call is used to delete a specific custom field.

Custom Widgets

This type of extensions lets you add widgets that help you analyze content of an entry and recommend content ideas. Read more.

Get all widgets

Try

The Get widgets request is used to get the information of all custom widgets created in a stack.

Get widgets of a content type

Try

The Get widgets of a content type request gets the comprehensive details of all widgets that are assigned to a specific content type.

Upload a widget

Try

The Upload a widget request is used to upload a new custom widget to a stack.

In the ‘Body’ section, you need to provide the following ‘Body’ parameters under ‘form-data’:

  • extension[upload]: Select the HTML file of the widget that you want to upload
  • extension[title]: Enter the title of the widget that you want to upload
  • extension[tags]: Enter the tags that you want to assign to the widget
  • extension[scope]: Enter either {"content_types":["$all"]} or {"content_types":["content_type_uid1”, “content_type_uid2”, “..."]} to apply this widget to all content types or specific content types, respectively
  • extension[type]: Enter type as ‘widget’, since this is a custom widget extension

Note: You can try the call manually in any REST API client, such as Postman. Under 'Body', for the extension[upload] parameter, select the input type as 'File'. This will enable you to select the file that you wish to import.

Create widget with source URL

Try

The Create Widget with source URL call is used to create a widget that is hosted externally.

In the ‘Body’ section, you need to provide details of the widget, such as its tags, title, external source link (src), configuration details, set if the extension is a widget or field, and specify the scope, i.e., the content types to which you want to apply the widget.

Create widget with source code

Try

The Create widget with source code request is used to create a widget in Contentstack by providing the source code. This source code will be hosted on Contentstack.

In the ‘Body’ section, you need to provide details of the widget, such as its tags, title, source code of the widget, configuration details, set if the extension is a widget or field, and specify the scope i.e., the content types that you want to apply the widget.

Update a widget

Try

The Update a widget request is used to update the details of a widget.

In the ‘Body’ section, you need to provide details of the widget, such as its tags, title, external source link (or the updated external source code), configuration details, set if the extension is a widget or field, and specify the scope i.e., the content types that you want to apply the widget.

Delete a widget

Try

The Delete a widget call is used to delete a specific custom widget.

Releases

You can pin a set of entries and assets (along with the deploy action, i.e., publish/unpublish) to a ‘release’, and then deploy this release to an environment. This will publish/unpublish all the the items of the release to the specified environment. Read more about Releases.

Releases Collection

Get all releases

Try

The Get all Releases request retrieves a list of all Releases of a stack along with details of each Release.

Get a single release

Try

The Get a single Release request gets the details of a specific Release in a stack.

When executing the API request, provide the Release UID as parameter.

Create a Release

Try

The Create a Release request allows you to create a new Release in your stack. To add entries/assets to a Release, you need to provide the UIDs of the entries/assets in ‘items’ in the request body.

Update a release

Try

The Update a Release call allows you to update the details of a Release, i.e., the ‘name’ and ‘description’.

When executing this API request, provide the Release UID as parameter. In the 'Body' section, you need to provide the new name and description of the Release that you want to update.

Delete a release

Try

The Delete a Release request allows you to delete a specific Release from a stack.

When executing the API request, provide the Release UID.

Release Items

Get all items in a release

Try

The Get all items in a Release request retrieves a list of all items (entries and assets) that are part of a specific Release.

When executing the API request, you need to provide the Release UID.

Add a single item to a Release

Try

The Add a single item to a Release request allows you to add an item (entry or asset) to a Release.

When executing the API request, you need to provide the Release UID. In the 'Body' section, you need to provide the details of the item such as the UID, version (of the entry), content type UID (of an entry), the action to be performed (publish/unpublish), and the locale of the item.

Add multiple items to a release

Try

The Add multiple items to a Release request allows you to add multiple items (entries and/or assets) to a Release.

When executing the API request, you need to provide the Release UID. In the 'Body' section, you need to provide the details of the items such as their UIDs, versions (in case of entries), content type UIDs (in case of entries), the action to be performed (publish/unpublish), and the locales of the items.

Note: In a single request, you can add maximum 25 items (entries/assets) to a Release.

Remove an item from a Release

Try

The Remove an item from a Release request removes one or more items (entries and/or assets) from a specific Release.

When executing the API request, provide the Release UID. In the 'Body' section, you need to provide the details of the item such as their UIDs, version (of the entry), content type UID (of an entry), the action to be performed (publish/unpublish), and the locale of the item.

Delete multiple items from a Release

Try

The Delete multiple items from a Release request deletes one or more items (entries and/or assets) from a specific Release.

When executing the API request, provide the Release UID. In the 'Body' section, you need to provide the UIDs of the items along with details such as their locale, versions, the action to be performed on the items (publish/unpublish), and content type UID of entries (if any).

Deploy/Execute a Release

Deploy a release

Try

The Deploy a Release request deploys a specific Release to specific environment(s) and locale(s).

When executing the API request, provide the Release UID. In the 'Body' section, you need to provide the details of the Release that you want to deploy. For example, you need to provide the action, environment(s), and the locale(s) on which the Release should be deployed.

Clone a Release

Clone a release

Try

The Clone a Release request allows you to clone (make a copy of) a specific Release in a stack.

When executing the API request, provide the Release UID. In the 'Body' section, you need to provide the new name and description of the cloned Release.

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.

Tokens

Delivery Tokens provide read-only access to the associated environments. Used along with the stack API key, it is used to make authorized Content Delivery API requests for retrieving the published content of an environment.

Read more about Delivery Tokens.

Delivery Token Collection

Get all delivery tokens

Try

The Get all delivery tokens request returns the details of all the delivery tokens created in a stack.

Get a single delivery token

Try

The Get a single delivery token request returns the details of all the delivery tokens created in a stack.

Create delivery token

Try

The Create delivery token request is used to create a delivery token in the stack.

In the Request Body, you need to pass the details of the delivery token in JSON format. The details include the name, description, and the environment of the delivery token.

Update delivery token

Try

The Update delivery token request lets you update the details of a delivery token.

In the Request Body, you need to pass the updated details of the delivery token in JSON format. The details include the updated name, description, and/or the environment of the delivery token.

Delete delivery token

Try

The Delete delivery token request deletes a specific delivery token.

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

The ‘Get all roles’ request returns comprehensive information about all roles created in a stack.

You can add queries to extend the functionality of this API request. 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 role

Try

The Get a single role request returns comprehensive information on a specific role.

Create a role

Try

The Create a role call creates a new role in a stack.

In the 'Body' section, mention the role name, description, users, additional roles, rules  (includes the actions that can be performed on entries, fields, and/or assets), 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.

In the 'Body' section, include the updated details of the role which include name, description, users, additional roles, rules (includes the actions that can be performed on entries, fields, and/or assets), 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.

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