Setting the file. One moment.
Subchapter 3.12
references/content-management/overview.mdMarkdown3 KBView on GitHub
The CMA is a read/write API for managing content, content types, assets, and environments.
https://api.contentful.comhttps://api.eu.contentful.comMost endpoints follow: https://api.contentful.com/spaces/{space_id}/environments/{environment_id}/.... Some are space-scoped and omit the environment segment (e.g., /spaces/{space_id}/environment_aliases/...).
Authorization: Bearer {cma_token}
Content-Type: application/vnd.contentful.management.v1+json # for write requests
X-Contentful-Version: {version} # for updates (optimistic locking)
X-Contentful-Content-Type: {content_type_id} # when creating entriescurl https://api.contentful.com/spaces/{space_id}/environments/master/entries/{entry_id} \
-H "Authorization: Bearer {cma_token}"curl -X POST https://api.contentful.com/spaces/{space_id}/environments/master/entries \
-H "Authorization: Bearer {cma_token}" \
-H "Content-Type: application/vnd.contentful.management.v1+json" \
-H "X-Contentful-Content-Type: blogPost" \
-d '{
"fields": {
"title": { "en-US": "Hello World" },
"body": { "en-US": "First post content." }
}
}'# First GET the entry to obtain sys.version, then:
curl -X PUT https://api.contentful.com/spaces/{space_id}/environments/master/entries/{entry_id} \
-H "Authorization: Bearer {cma_token}" \
-H "Content-Type: application/vnd.contentful.management.v1+json" \
-H "X-Contentful-Version: 5" \
-d '{
"fields": {
"title": { "en-US": "Updated Title" },
"body": { "en-US": "Updated content." }
}
}'curl -X PUT https://api.contentful.com/spaces/{space_id}/environments/master/entries/{entry_id}/published \
-H "Authorization: Bearer {cma_token}" \
-H "X-Contentful-Version: 6"X-Contentful-Version header matching current sys.version. See http-conventions.md.{"en-US": "value"}. See http-conventions.md.PUT .../published.