$npx -y skills add contentful/skills --skill contentful-apiComprehensive Contentful REST API guide. Covers Content Management API (CMA) for creating/updating content, Content Delivery API (CDA) for fetching published content, Preview API, Images API, and GraphQL API. All examples use curl/HTTP — language-agnostic.
| 1 | # Contentful REST API Guide |
| 2 | |
| 3 | Language-agnostic guide for Contentful APIs using HTTP/curl. |
| 4 | |
| 5 | ## Shared References |
| 6 | |
| 7 | - **[Authentication](references/authentication.md)** — Token types, auth headers, API base URLs (US/EU) |
| 8 | - **[HTTP Conventions](references/http-conventions.md)** — Version locking, rate limits, pagination, errors, locale structure |
| 9 | |
| 10 | ## Content Management API (CMA) |
| 11 | |
| 12 | Read/write API for managing content, content types, assets, and environments. |
| 13 | |
| 14 | **Start here**: [references/content-management/overview.md](references/content-management/overview.md) |
| 15 | |
| 16 | - [**entries.md**](references/content-management/entries.md) — CRUD, publish/unpublish, versioning, query parameters |
| 17 | - [**content-types.md**](references/content-management/content-types.md) — Define/update content models, field types, validations |
| 18 | - [**assets.md**](references/content-management/assets.md) — Upload, process, publish media files |
| 19 | - [**environments.md**](references/content-management/environments.md) — Create, clone, manage environments and aliases |
| 20 | |
| 21 | ## Content Delivery API (CDA) |
| 22 | |
| 23 | Read-only API for fetching published content. |
| 24 | |
| 25 | **Start here**: [references/content-delivery/overview.md](references/content-delivery/overview.md) |
| 26 | |
| 27 | - [**querying.md**](references/content-delivery/querying.md) — Filters, search operators, pagination, ordering |
| 28 | - [**includes-links.md**](references/content-delivery/includes-links.md) — Include parameter, link resolution |
| 29 | - [**localization.md**](references/content-delivery/localization.md) — Locale parameter, fallback chains |
| 30 | - [**sync.md**](references/content-delivery/sync.md) — Incremental content synchronization |
| 31 | |
| 32 | ## Content Preview API |
| 33 | |
| 34 | Draft + published content via same CDA endpoints, different host/token. |
| 35 | |
| 36 | **Reference**: [references/content-preview/overview.md](references/content-preview/overview.md) |
| 37 | |
| 38 | ## Images API |
| 39 | |
| 40 | On-the-fly image transformations via URL parameters. No authentication needed. |
| 41 | |
| 42 | **Reference**: [references/images/overview.md](references/images/overview.md) |
| 43 | |
| 44 | ## GraphQL API |
| 45 | |
| 46 | Query content via GraphQL with CDA tokens. |
| 47 | |
| 48 | **Reference**: [references/graphql/overview.md](references/graphql/overview.md) |
| 49 | |
| 50 | ## Quick Reference |
| 51 | |
| 52 | ```bash |
| 53 | # CMA: Create a draft entry |
| 54 | curl -X POST https://api.contentful.com/spaces/{space_id}/environments/{env_id}/entries \ |
| 55 | -H "Authorization: Bearer {cma_token}" \ |
| 56 | -H "Content-Type: application/vnd.contentful.management.v1+json" \ |
| 57 | -H "X-Contentful-Content-Type: blogPost" \ |
| 58 | -d '{"fields":{"title":{"en-US":"Hello"}}}' |
| 59 | # Then publish: PUT .../entries/{id}/published with X-Contentful-Version header |
| 60 | |
| 61 | # CDA: Fetch entries |
| 62 | curl "https://cdn.contentful.com/spaces/{space_id}/environments/{env_id}/entries?content_type=blogPost" \ |
| 63 | -H "Authorization: Bearer {cda_token}" |
| 64 | ``` |