Content Management API
[API VERSION : 3.0.0]Introduction
Base URL
For US region: https://api.contentstack.io/
For European region: https://eu-api.contentstack.com/
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 (CMA) 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 a Management Token or an 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
Contentstack provides token-based authentication that allows you to create, update, delete, and fetch the content of your Contentstack account. You can use either the stack’s Management Token or the user Authtoken, along with the stack API key, to make Content Management API requests. The API key is a unique key assigned to each stack.
Management Tokens are stack-level read-write tokens that allow making CMA requests without the need to provide user credentials. However, Authtokens are user-specific tokens generated when user logs in to Contentstack. Read more about the different types of tokens.
- For API Key and Authtoken-based authentication:
- Pass the stack’s API key against the
api_key
parameter as header - Pass the user Authtoken against the
authtoken
parameter as header
- Pass the stack’s API key against the
- For API Key and Management Token-based authentication:
- Pass the stack’s API key against the
api_key
parameter as header - Pass the user Management Token value against the
authorization
parameter as header
- Pass the stack’s API key against the
Authtokens vs Management Tokens
An Authtoken is a read-write token used to make authorized CMA requests, and it is a user-specific token. This means that your personal user details are attached to every API request that you make using the authtoken. So, if a person were to obtain access to your authtoken, and knows the Stack API key, this person would be able to make API requests that appeared to be coming from you.
Management Tokens, on the other hand, are stack-level tokens, with no users attached to them. They can do everything that authtokens can do. Since they are not personal tokens, no role-specific permissions are applicable to them. It is recommended to use these tokens for automation scripts, third-party app integrations, and for Single Sign On (SSO)-enabled organizations.
Authtoken lets you make almost all the Content Management requests, while with Management Tokens, you have a few limitations (read them here).
How to Get Stack API Key
To retrieve the stack API key, perform the steps given below:
- Go to your stack.
- Navigate to Settings > Stack.
- On the right-hand side of the page, under API CREDENTIALS, you will get the API Key of your stack.
Note: Only the developers, admins and stack owners can view the API key.
How to Get Authtoken
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.
How to Get Management Tokens
To get the Management Token, perform the steps given below after logging into your Contentstack account:
- Go to your stack.
- Navigate to Settings > Tokens > Delivery Tokens.
- From the list, pick the Management Token that you want.
Read more about how you can create a new Management Token.
Note: Only the stack Owner and Admin users can create Management Tokens.
You can generate multiple management tokens for a specific stack within your organization. However, there is a maximum limit of 10 valid tokens that can exist per stack at a time, to execute CMA requests. If you already have 10 valid tokens, creating a new management token will automatically cause the oldest management token to expire without warning.
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.
Also, we have set a limit on stack creation. Organizations can create only one stack per minute.
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. |
Warning: 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
and for the European region the base URL iseu-api.contentstack.com
. - The API version (in our case, 'v3') can be found in the URL, e.g.
api.contentstack.io/v3/endpoint
. - Content Management API supports GET/POST/PUT/DELETE verbs or methods.
- URL paths are written in 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 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 request is syntactically correct but contains semantic errors |
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 userTry
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.
Try
The Update User
API Request 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.
Note: To update the role of an existing user, refer the Update Existing User Role API Request.
Delete userTry
The Delete user
call deletes the current authenticated user permanently from your Contentstack account.
Activate User
Activate a user accountTry
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 passwordTry
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 passwordTry
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 accountTry
The Log in to your account
request 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.
For SSO-enabled organizations, the ‘Log in to your account’ request will not return the user authtoken for users. In this case, you can try out the following:
- The owner of an organization can access the SSO-enabled organization through Contentstack credentials and retrieve the user authtoken to make Content Management API requests.
- Disable 'Strict Mode' for an SSO-enabled organization, and users who have the ability to access their organization through Contentstack credentials can retrieve the authtoken to make Content Management API requests.
For more details, refer the REST API Usage - Content Management API section in the Single Sign-On page.
Log out of your accountTry
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 OrganizationsTry
The Get all organizations
call lists all organizations related to the system user in the order that they were created.
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 OrganizationTry
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 OrganizationTry
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 invitationTry
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 invitationsTry
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 ownershipTry
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 OrganizationTry
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 stacksTry
The Get all stacks
call fetches the list of all stacks owned by and shared with a particular user account.
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.
Note: For SSO-enabled organizations, it is mandatory to pass the organization UID in the header.
Create stackTry
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.
Note: At any given point of time, an organization can create only one stack per minute.
Update stackTry
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.
Warning: 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 stackTry
The Delete stack
call is used to delete an existing stack permanently from your Contentstack account.
Get all users
Get all users of a stackTry
The Get all users of a stack
call fetches the list of all users of a particular stack
Update Existing User Role
Update User RoleTry
The Update User Role
API Request updates the roles of an existing user account. This API Request will override the existing roles assigned to a user. For example, we have an existing user with the "Developer" role, and if you execute this API request with "Content Manager" role, the user role will lose "Developer" rights and the user role be updated to just "Content Manager".
When executing the API call, under the 'Body' section, enter the UIDs of roles that you want to assign a user. This information should be in JSON format.
Transfer Stack Ownership
Transfer stack ownership to other usersTry
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 userTry
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 settingsTry
The Get stack settings
call retrieves the configuration settings of an existing stack.
Try
The Add stack settings
call lets you add settings for an existing stack.
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 stackTry
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 stackTry
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 typesTry
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.
Tip: If any of your content types contains a Global field and you wish to fetch the content schema of the Global field, then you need to pass theinclude_global_field_schema:true
parameter. This parameter helps return the Global field's schema along with the content type schema.
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: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Get a single content typeTry
The Get a single content type
call returns information of a specific content type.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Enter the version of the content type of which you want to retrieve the details as a query parameter. If no version is specified, you will get the latest version of the 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.
To learn more about the queries, refer to the Queries section of the Content Delivery API doc.
Tip: If any of your content types contains a Global field and you wish to fetch the content schema of the Global field, then you need to pass theinclude_global_field_schema:true
parameter. This parameter helps return the Global field's schema along with the content type schema.
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.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
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.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Delete Content TypeTry
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.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Content Type References
Get all references of content typeTry
The Get all referenced content types
call will fetch all the content types in which the current content type is referenced.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Export Content Type
Export a content typeTry
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.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Import Content Type
Import a content typeTry
The Import a content type
call imports a content type into a stack.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
To import, you need to provide/upload a JSON file that contains the schema of the content type that you wish to import.
Tip: 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.
Global Fields
A Global field is a reusable field (or group of fields) that you can define once and reuse in any content type within your stack. This eliminates the need (and thereby time and efforts) to create the same set of fields repeatedly in multiple content types. Read more about Global fields.
Global Field Collection
Get all global fieldsTry
The Get all global fields
call returns comprehensive information of all the global fields available in a particular stack in your account.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Get a single global fieldTry
The Get a single global field
request allows you to fetch comprehensive details of a specific global field.
When executing the API call, in the 'URI Parameters' section, provide the unique ID of your global field.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Create a global fieldTry
The Create a global field
request allows you to create a new global field in a particular stack of your Contentstack account. You can use this global field in any content type within your stack.
Note: Only the stack owner, administrator, and developer can create global fields.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Update a global fieldTry
The Update a global field
request allows you to update the schema of an existing global field.
When executing the API call, in the 'URI Parameters' section, provide the unique ID of your global field.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Delete global fieldTry
The Delete global field
request allows you to delete a specific global field.
Warning: If your Global field has been referred within a particular content type, then you will need to pass an additional query parameter force:true
to delete the Global field.
When executing the API call, in the 'URI Parameters' section, provide the unique ID of your global field.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Import Global Field
Import a global fieldTry
The Import a global field
call imports a global field into a stack.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
To import, you need to provide/upload a JSON file that contains the schema of the global field that you wish to import.
Tip: You can try the call manually in any REST API client, such as Postman, by passing a 'Body' parameter named global_field
and selecting the input type as 'File'. Then, select the JSON file of the global field that you wish to import.
Export Global Field
Export a global fieldTry
This request is used to export a specific global field and its schema. The data is exported in JSON format.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
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 entriesTry
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.
Tip: This request returns only the first 100 entries of the specified content type. If you get more than 100 items in your response, refer the Pagination section to retrieve all your entries in paginated form. Also, 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.
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.
Tip: 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.
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.
Note: The Update an entry
call does not allow you to update the workflow stage for an entry. To update the workflow stage for the entry, use the Set Entry Workflow Stage call.
Try
The Delete an entry
call is used to delete a specific entry from a content type.
Entry Version Naming
Version naming allows you to assign a name to a version of an entry for easy identification. For more information, refer the documentation.
Set Version Name for EntryTry
The Set Version Name for Entry
request allows you to assign a name to a specific version of an entry.
In the request body, you need to specify the version name to be assigned and the locale of the entry.
Tip: You can add an additional parameter force:true
to force update the version name of the master entry.
Try
The Get Details of All Versions of an Entry
request allows you to retrieve the details of all the versions of an entry.
The version details returned include the actual version number of the entry; the version name along with details such as the assigned version name, the UID of the user who assigned the name, and the time when the version was assigned a name; and the locale of the entry.
Note: If an entry is unlocalized, the version details of entries published in the master locale will be returned.
Delete Version Name of EntryTry
The Delete Version Name of Entry
request allows you to delete the name assigned to a specific version of an entry. This request resets the name of the entry version to the version number.
Entry References
Get references of an entryTry
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 entryTry
The Get languages of an entry
call returns the details of all the languages that an entry exists in.
Localize an Entry
Localize an entryTry
The Localize an entry
request allows you to localize an entry i.e., the entry will cease to fetch data from its fallback language and possess independent content specific to the selected locale.
In the "Body" parameter, you need to provide the content of your entry based on the content type.
Note: This request will only create the localized version of your entry and not publish it. To publish your localized entry, you need to use the Publish an entry request and pass the respective locale code in the locale={locale_code}
parameter.
Refer the Localization docs for more information.
Unlocalize Entry
Unlocalize an entryTry
The Unlocalize an entry
request is used to unlocalize an existing entry. Read more about Unlocalization.
Export Entry
Export an entryTry
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.
Tip: You can try the call manually in any REST API client, such as Postman. You can export the required entry's JSON file, make the necessary changes to the data and then import the entry. While importing, you need to pass a form-data parameter named entry
and select the input type as 'File'. Then, select the JSON file of the entry that you wish to import.
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.
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 entryTry
The Publish an entry
request lets you publish an entry either immediately or schedule it for a later date/time.
In the 'Body' section, you can specify the locales and environments to which you want to publish the entry. When you pass locales in the "Body", the following actions take place:
- If you have not localized your entry in the above-mentioned locales, the Master Locale entry gets localized in those locales and are published
- If you have localized your entry in the above-mentioned locales, the existing localized content is published.
The locale and environment details should be specified in the ‘entry’ parameter. However, if you do not specify any source locale(s), it will be published in the master locale automatically.
Along with the above details, 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 entryTry
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 assetsTry
The Get all assets
request 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.
Tip: 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.
Try
The Get assets of a specific folder
retrieves all assets of a specific asset folder; however, it doesn't retrieve the details of subfolders within it.
Try
The Get assets and folders of a parent folder
retrieves details of both assets and asset subfolders within a specific parent asset folder.
Try
The Get an asset
call returns comprehensive information about a specific version of an asset of a stack.
Tip: 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.
Try
The Upload asset
call uploads a file to your stack.
Tip: 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.
Try
The Replace asset
call will replace an existing asset with another file on the stack.
Tip: 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.
Try
The Delete asset
call will delete an existing asset from the stack.
Rich Text Editor Assets
Get information on RTE assetsTry
The Get information on RTE assets
call returns comprehensive information on all assets uploaded through the Rich Text Editor field.
Asset Version Naming
Version naming allows you to assign a name to a version of an asset for easy identification. For more information, refer the documentation.
Set Version Name for AssetTry
The Set Version Name for Asset
request allows you to assign a name to a specific version of an asset.
In the request body, you need to specify the version name to be assigned to the asset version.
Get Details of All Versions of an AssetTry
The Get Details of All Versions of an Asset
request allows you to retrieve the details of all the versions of an asset.
The details returned include the actual version number of the asset; the version name along with details such as the assigned version name, the UID of the user who assigned the name, and the time when the verison was assigned a name; and the count of the versions.
Delete Version Name of AssetTry
The Delete Version Name of Asset
request allows you to delete the name assigned to a specific version of an asset. This request resets the name of the asset version to the version number.
Asset Reference
Get asset referencesTry
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 videosTry
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 revisionTry
The Update asset revision
call upgrades a specified version of an asset as the latest version of that asset.
An alternative way to pass the version number is in the form of 'raw' data, shown as follows:
{ "asset": { "title": "Title", "description": "Description" }, "version": 3 }
Tip: 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.
Try
The Update asset
call updates the title and description of an asset.
Note: This call updates only the meta data of an asset. To replace an asset, try the Replace asset request under Asset Collection.
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" } }
Tip: 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. You can assign a parent folder to your asset by using the asset[parent_uid]
parameter, where you need to pass the UID of the parent folder. These details are to be passed as form-data.
Publish Asset
Publish an assetTry
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 assetTry
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 folderTry
The Get a single folder
call gets the comprehensive details of a specific asset folder by means of folder UID.
When executing the API call to search for a subfolder, you need to provide the parent folder UID.
Get a single folder (by name)Try
The Get a single folder (by name)
call retrieves a specific asset folder based on the name provided.
Try
The Get subfolders of a parent folder
request retrieves the details of only the subfolders of a specific asset folder. This request does not retrieve asset files.
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 folderTry
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.
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.
Bulk Operations
You can perform bulk operations such as Publish, Unpublish, and Delete on multiple entries or assets, or Change the Workflow Details of multiple entries or assets at the same time.
Additional Resource: You can also learn how to perform bulk operations on search results.
Bulk Publish Operation
Try
The Publish entries and assets in bulk request allows you to publish multiple entries and assets at the same time.
Note: At a time, you can publish 10 entries in 10 languages and on 10 environments.
In the 'Body' section, you need to specify the locales (mention the locale codes) and environments (mention the names) to which you want to publish the entries or assets. If you do not specify a source locale, the entries or assets will be published in the master locale automatically.
Tip: To schedule the publishing of multiple entries and/or assets, you can make use of the ‘Create a Release’ request. Then, you can deploy this Release and all of the pinned items can be published together either immediately or at a scheduled time to whatever environment you choose.
Within the ‘entries’ parameter, pass these details of each entry – content type UIDs, entry UIDs, master locales, and the version that you want to publish. Within the ‘assets’ parameter, pass these details of each entry – asset UIDs and the version that you want to publish (optional).
Warning: If any one of the items (entries/assets) added to a release do not satisfy the applied publish rules, then all the pinned items will not be published. Pass an additional query parameter skip_workflow_stage_check:true to publish the pinned items (entries/assets) that are at a workflow stage where they satisfy the applied publish rules. You may also need to add another query parameter, approvals:true, to publish the entries that do not require an approval to be published.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Bulk Unpublish Operation
Unpublish entries and assets in bulkTry
The Unpublish entries and assets in bulk request allows you to unpublish multiple entries and assets at the same time.
In the 'Body' section, you need to specify the locales (mention the locale codes) and environments (mention the names) to which you want to unpublish the entries or assets. If you do not specify a source locale, the entries or assets will be unpublished in the master locale automatically.
Tip: To schedule the unpublishing of multiple entries and/or assets, you can make use of the ‘Create a Release’ request. Then, you can deploy this Release and all of the pinned items can be unpublished together either immediately or at a scheduled time to whatever environment you choose.
Within the ‘entries’ parameter, pass these details of each entry – content type UIDs, entry UIDs, master locales, and the version that you want to unpublish. Within the ‘assets’ parameter, pass these details of each entry – asset UIDs and the version that you want to unpublish (optional).
Warning: If any one of the items (entries/assets) added to a release do not satisfy the applied publish rules, then all the pinned items will not be unpublished. Pass an additional query parameter skip_workflow_stage_check:true to unpublish the pinned items (entries/assets) that are at a workflow stage where they satisfy the applied publish rules. You may also need to add another query parameter, approvals:true, to publish the entries that do not require an approval to be unpublished.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Bulk Delete Operation
Delete entries and assets in bulkTry
The Delete entries and assets in bulk request allows you to delete multiple entries and assets at the same time.
In the 'Body' section, you need to specify the content type UIDs, entry UIDs or asset UIDs, and master locales of the entries or assets that you want to delete.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
Bulk Update Workflow Details Operation
The ‘Change Workflow Details’ action is a new option that allows you to change workflow details (such as stage, assignee, due date, and comments) of multiple entries at the same time. Read more about how this option works.
Update workflow details in bulkTry
The Update workflow details in bulk request allows you to update the workflow details for multiple entries at the same time.
Note: You can change the workflow stage of multiple entries only if all the entries have been assigned the same workflow stage and are associated with the same workflow.
In the 'Body' section, you need to provide the details of the workflow stage. Enter a comment for the assigned user, if needed; provide the due date; set notification settings to ‘true’, so that the specified user will be notified of it; enter the UID of the workflow stage; and finally, enter the user details, such as UID, name, and email address of the user.
Within the ‘entries’ parameter, pass these details of each entry – content type UIDs, entry UIDs, and master locales.
Note: You need to use either the stack’s Management Token or the user Authtoken (any one is mandatory), along with the stack API key, to make a valid Content Management API request. Read more about authentication.
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 fieldsTry
The Get all custom fields
request is used to get the information of all custom fields created in a stack.
Try
The Get a single custom field
request gets the comprehensive details of a specific 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.
Tip: 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.
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 codeTry
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 fieldTry
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 fieldTry
The Delete custom field
request is used to delete a specific custom field.
Try
The Create Content Type with Extension Field
request is used to create a content type that includes a 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 widgetsTry
The Get widgets
request is used to get the information of all custom widgets created in a stack.
Try
The Get widgets of a content type
request gets the comprehensive details of all widgets that are assigned to a specific content type.
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
Tip: 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.
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 codeTry
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 widgetTry
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 widgetTry
The Delete a widget
call is used to delete a specific custom widget.
Dashboard Widgets
This type of extension lets you create widgets for your dashboard. Read more.
Get All Dashboard WidgetsTry
The Get All Dashboard Widgets
request is used to get the information of all the enabled custom dashboard extension.
Try
The Upload Dashboard Widget
request uploads the widget to the Stack Dashboard.
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[type]: Enter type as ‘dashboard’, since this is a custom widget extension.
Try
The Create a Dashboard Widget with Source URL
request is used to upload an extension hosted externally.
In the ‘Body’ section, you need to provide details of the dashboard widget, such as its tags, title, external source link (src), configuration details, and set if the extension is a widget or field.
Create a Dashboard Widget with Source codeTry
The Create dashboard 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, and set if the extension is a widget or field.
Update the Dashboard WidgetTry
The Update dashboard widget
request is used to update the details of an widget.
In the ‘Body’ section, you need to provide details of the extension, such as its tags, data type, title, and configuration details.
Delete the Dashboard WidgetTry
The ‘Delete a dashboard widget’ call is used to delete a specific custom dashboard.
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 ReleasesTry
The Get all Releases
request retrieves a list of all Releases of a stack along with details of each 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 ReleaseTry
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.
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 ReleaseTry
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 ReleaseTry
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 ReleaseTry
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 ReleaseTry
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 ReleaseTry
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 ReleaseTry
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 ReleaseTry
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 ReleaseTry
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.
Workflows
Workflow is a tool that allows you to streamline the process of content creation and publishing, and lets you manage the content lifecycle of your project smoothly.
Workflow Collection
Get all workflowsTry
The Get all Workflows
request retrieves the details of all the Workflows of a stack.
Try
The Get a Single Workflow
request retrieves the comprehensive details of a specific Workflow of a stack.
Try
The Create a Workflow
request allows you to create a Workflow.
In the 'Body' section, you can provide the details of the workflow that includes name, content types, owners, description, and workflow stages of your Workflow.
Add or update workflow detailsTry
The Add or Update Workflow
request allows you to add a workflow stage or update the details of the existing stages of a workflow.
In the 'Body' section, you can provide the updated details of the name, content types, owners, description, and workflow stages of your Workflow.
Disable workflowTry
The Disable Workflow
request allows you to disable a workflow.
Try
The Enable Workflow
request allows you to enable a workflow.
Try
The Delete Workflow
request allows you to delete a workflow.
Entry Workflow Stages
Set entry workflow stageTry
The Set Entry Workflow Stage
request allows you to either set a particular workflow stage of an entry or update the workflow stage details of an entry.
In the 'Body' section, you need to provide the details of the workflow stage. Enter a comment for the assigned user, if needed; provide the due date; set notification settings to ‘true’, so that the specified user will be notified of it; enter the UID of the workflow stage; and finally, enter the user details, such as UID, name, and email address of the user.
Publish Rules Collection
Create publish rulesTry
The Create Publish Rules
request allows you to create publish rules for the workflow of a stack.
Try
The Add or Update Publish Rules
request allows you to add a publish rule or update the details of the existing publish rules of a workflow.
Try
The Delete Publish Rules
request allows you to delete an existing publish rule.
Try
The Get all Publish Rules
request retrieves the details of all the Publish rules of a workflow.
Try
The Get a Single Publish Rule
request retrieves the comprehensive details of a specific publish rule of a Workflow.
Publish Rules by Content Types
Get publish rules by content typesTry
The Get Publish Rules by Content Types
request allows you to retrieve details of a Publish Rule applied to a specific content type of your stack.
When executing the API request, 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.
Publish Request Approval
Request/Accept/Reject Entry Publish RequestTry
This multipurpose request allows you to either send a publish request or accept/reject a received publish request.
When executing the API request, 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 details of the publish rule, such as its UID, action (‘publish’, ‘unpublish’, or ’both’), status (this could be ‘0’ for Approval Requested, ‘1’ for ‘Approval Accepted’, and ‘-1’ for ‘Approval Rejected’), notification setting, and comment for the approver.
Workflow Tasks
Get all TasksTry
The Get all Tasks
request retrieves a list of all tasks assigned to you.
When executing the API request, 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.
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 labelsTry
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 labelTry
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 labelTry
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 labelTry
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 labelTry
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 languagesTry
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 languageTry
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 languageTry
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 languageTry
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 languageTry
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.
Fallback Languages
Language fallback allows entries created in a particular language to initially inherit data from the fallback language instead of directly inheriting content from the master language. For more information, refer the documentation for Fallback Language.
Set a fallback languageTry
The ‘Set a fallback language’ request allows you to assign a fallback language for an entry in a particular language.
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 in to your account.
In the 'Body' section, enter the language codes in JSON format.
Note: The language set as a fallback language will always inherit data from the master language if it does not have localized content.
Update fallback languageTry
The ‘Update fallback language’ request allows you to update the fallback language for an existing language of 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 in to your account.
In the 'Body' section, enter the updated details of the fallback language in JSON format.
Note: The language set as a fallback language will always inherit data from the master language if it does not have localized content.
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 environmentsTry
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 environmentTry
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 environmentTry
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 environmentTry
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 environmentTry
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 tokensTry
The Get all delivery tokens
request returns the details of all the delivery tokens created in a stack.
Try
The Get a single delivery token
request returns the details of all the delivery tokens created in a stack.
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.
Note: It is highly recommended to set only one publishing environment per delivery token.
Update delivery tokenTry
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 tokenTry
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 rolesTry
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.
Try
The Get a single role
request returns comprehensive information on a specific 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).
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).
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 webhooksTry
This call returns comprehensive information on all the available webhooks in the specified stack.
Tip: 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 webhookTry
The Get a webhook
call 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 webhookTry
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 webhookTry
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 webhookTry
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.
Export Webhook
Export a WebhookTry
The Export a Webhook
request exports an existing webhook. The exported webhook data is saved in a downloadable JSON file.
Import Webhook
The 'Import Webhook' section consists of the following two requests that will help you to import new Webhooks or update existing ones 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 webhook
under form-data
. Select the input type as 'File' and select the JSON file of the webhook that you want to import.
Try
The Import Webhook
request imports a webhook. To import a webhook, you need to upload a JSON file with the webhook data.
Try
The Import an Existing Webhook
request will allow you to update the details of an existing webhook.
Get Webhook Executions
Get executions of a webhookTry
The Get executions of a webhook
call will provide the execution details of a specific webhook, which includes the execution UID. This detail is instrumental in retrieving webhook logs and retrying a failed webhook. Each execution of a webhook is assigned a unique UID that allows you to gather information, such as request-response body, retry attempts, and so on, pertaining to a specific execution of the webhook.
This API request will return a maximum of 100 records while fetching the execution details for a specific webhook. Previously, there was no limit on the number of records returned. You can use the "skip" parameter to fetch older records.
Webhook Retry
Retry a webhookTry
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.
Get Execution Log
Get latest execution log of a webhookTry
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.
