Content
Content types and entries endpoints
Content
Create, read, update, and delete content types and entries.
Endpoints
/v1/content/{tenant_id}/typesList Content Types
Retrieve all content types defined in your tenant.
Path Parameters
| Name | Type | Description |
|---|---|---|
tenant_id | string | Your tenant ID. |
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number for pagination. |
per_page | integer | 25 | Number of results per page. |
curl -X GET "https://api.knitt.co/v1/content/ten_abc123/types?page=1&per_page=25" \ -H "Authorization: Bearer YOUR_API_KEY"
Response
Returns a paginated list of content types with their field definitions.
{
"data": [
{
"id": "ct_abc123",
"name": "Blog Posts",
"slug": "blog-posts",
"fields": [
{
"name": "title",
"type": "text",
"required": true
},
{
"name": "body",
"type": "rich_text",
"required": true
},
{
"name": "featured_image",
"type": "media",
"required": false
}
],
"created_at": "2026-01-15T10:30:00Z"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 3
}
}/v1/content/{tenant_id}/types/{content_type_id}Get Content Type
Retrieve a single content type by its ID.
Path Parameters
| Name | Type | Description |
|---|---|---|
tenant_id | string | Your tenant ID. |
content_type_id | string | The ID of the content type. |
curl -X GET "https://api.knitt.co/v1/content/ten_abc123/types/ct_abc123" \ -H "Authorization: Bearer YOUR_API_KEY"
Response
Returns the content type object.
{
"data": {
"id": "ct_abc123",
"name": "Blog Posts",
"slug": "blog-posts",
"fields": [
{
"name": "title",
"type": "text",
"required": true
},
{
"name": "body",
"type": "rich_text",
"required": true
},
{
"name": "featured_image",
"type": "media",
"required": false
}
],
"created_at": "2026-01-15T10:30:00Z"
}
}/v1/content/{tenant_id}/typesCreate Content Type
Create a new content type with a name, slug, and field definitions.
Path Parameters
| Name | Type | Description |
|---|---|---|
tenant_id | string | Your tenant ID. |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name for the content type. |
slug | string | No | URL-friendly slug. Auto-generated from name if omitted. |
fields | array | Yes | Array of field definitions. Each field needs a name and type. |
curl -X POST "https://api.knitt.co/v1/content/ten_abc123/types" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Blog Posts",
"slug": "blog-posts",
"fields": [
{
"name": "title",
"type": "text",
"required": true
},
{
"name": "body",
"type": "rich_text",
"required": true
},
{
"name": "featured_image",
"type": "media",
"required": false
}
]
}'Response
Returns the created content type.
{
"data": {
"id": "ct_abc123",
"name": "Blog Posts",
"slug": "blog-posts",
"fields": [
{
"name": "title",
"type": "text",
"required": true
},
{
"name": "body",
"type": "rich_text",
"required": true
},
{
"name": "featured_image",
"type": "media",
"required": false
}
],
"created_at": "2026-01-15T10:30:00Z"
}
}/v1/content/{tenant_id}/types/{content_type_id}Update Content Type
Update an existing content type. You can modify the name, slug, or field definitions.
Path Parameters
| Name | Type | Description |
|---|---|---|
tenant_id | string | Your tenant ID. |
content_type_id | string | The ID of the content type. |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | No | New display name. |
slug | string | No | New slug. |
fields | array | No | Updated field definitions. |
curl -X PUT "https://api.knitt.co/v1/content/ten_abc123/types/ct_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Articles",
"slug": "articles"
}'Response
Returns the updated content type.
{
"data": {
"id": "ct_abc123",
"name": "Articles",
"slug": "articles",
"fields": [
{
"name": "title",
"type": "text",
"required": true
},
{
"name": "body",
"type": "rich_text",
"required": true
},
{
"name": "featured_image",
"type": "media",
"required": false
}
],
"updated_at": "2026-01-16T08:00:00Z"
}
}/v1/content/{tenant_id}/types/{content_type_id}Delete Content Type
Permanently delete a content type and all of its entries. This action cannot be undone.
This permanently deletes all entries associated with this content type.
Path Parameters
| Name | Type | Description |
|---|---|---|
tenant_id | string | Your tenant ID. |
content_type_id | string | The ID of the content type. |
curl -X DELETE "https://api.knitt.co/v1/content/ten_abc123/types/ct_abc123" \ -H "Authorization: Bearer YOUR_API_KEY"
Response
Returns a confirmation message.
{
"message": "Content type deleted successfully."
}/v1/content/{tenant_id}/types/{content_type_id}/entriesList Entries
Retrieve all entries for a given content type. Supports pagination, filtering, and sorting.
Path Parameters
| Name | Type | Description |
|---|---|---|
tenant_id | string | Your tenant ID. |
content_type_id | string | The ID of the content type. |
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number. |
per_page | integer | 25 | Results per page (max 100). |
sort | string | — | Field to sort by. Prefix with - for descending. |
filter[field] | string | — | Filter entries by field value. |
search | string | — | Full-text search across all text fields. |
curl -X GET "https://api.knitt.co/v1/content/ten_abc123/types/ct_abc123/entries?page=1&per_page=25&sort=-created_at&filter%5Bfield%5D=filter%5Bstatus%5D%3Dpublished&search=getting%20started" \ -H "Authorization: Bearer YOUR_API_KEY"
Response
Returns a paginated list of entries.
{
"data": [
{
"id": "ent_xyz789",
"content_type_id": "ct_abc123",
"fields": {
"title": "Getting Started with Knitt",
"body": "<p>Welcome to Knitt...</p>",
"featured_image": {
"url": "https://cdn.knitt.co/image.jpg",
"alt": "Hero image"
}
},
"status": "published",
"created_at": "2026-01-20T14:00:00Z",
"updated_at": "2026-01-21T09:15:00Z"
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 42
}
}/v1/content/{tenant_id}/types/{content_type_id}/entries/{entry_id}Get Entry
Retrieve a single entry by its ID.
Path Parameters
| Name | Type | Description |
|---|---|---|
tenant_id | string | Your tenant ID. |
content_type_id | string | The ID of the content type. |
entry_id | string | The ID of the entry. |
curl -X GET "https://api.knitt.co/v1/content/ten_abc123/types/ct_abc123/entries/ent_xyz789" \ -H "Authorization: Bearer YOUR_API_KEY"
Response
Returns the entry object with all field data.
{
"data": {
"id": "ent_xyz789",
"content_type_id": "ct_abc123",
"fields": {
"title": "Getting Started with Knitt",
"body": "<p>Welcome to Knitt...</p>",
"featured_image": {
"url": "https://cdn.knitt.co/image.jpg",
"alt": "Hero image"
}
},
"status": "published",
"created_at": "2026-01-20T14:00:00Z",
"updated_at": "2026-01-21T09:15:00Z"
}
}/v1/content/{tenant_id}/types/{content_type_id}/entriesCreate Entry
Create a new entry for a content type.
Path Parameters
| Name | Type | Description |
|---|---|---|
tenant_id | string | Your tenant ID. |
content_type_id | string | The ID of the content type. |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
fields | object | Yes | An object of field values matching the content type schema. |
status | string | No | Entry status: draft or published. |
curl -X POST "https://api.knitt.co/v1/content/ten_abc123/types/ct_abc123/entries" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"title": "Getting Started with Knitt",
"body": "<p>Welcome to Knitt, the modular headless CMS.</p>"
},
"status": "published"
}'Response
Returns the created entry.
{
"data": {
"id": "ent_xyz789",
"content_type_id": "ct_abc123",
"fields": {
"title": "Getting Started with Knitt",
"body": "<p>Welcome to Knitt, the modular headless CMS.</p>"
},
"status": "published",
"created_at": "2026-01-20T14:00:00Z"
}
}/v1/content/{tenant_id}/types/{content_type_id}/entries/{entry_id}Update Entry
Update an existing entry. You only need to send the fields you want to change.
Path Parameters
| Name | Type | Description |
|---|---|---|
tenant_id | string | Your tenant ID. |
content_type_id | string | The ID of the content type. |
entry_id | string | The ID of the entry. |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
fields | object | No | Object of field values to update. |
status | string | No | New status: draft or published. |
curl -X PATCH "https://api.knitt.co/v1/content/ten_abc123/types/ct_abc123/entries/ent_xyz789" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"title": "Updated Title"
},
"status": "published"
}'Response
Returns the updated entry.
{
"data": {
"id": "ent_xyz789",
"content_type_id": "ct_abc123",
"fields": {
"title": "Updated Title",
"body": "<p>Welcome to Knitt, the modular headless CMS.</p>"
},
"status": "published",
"updated_at": "2026-01-21T09:15:00Z"
}
}/v1/content/{tenant_id}/types/{content_type_id}/entries/{entry_id}Delete Entry
Permanently delete an entry. This action cannot be undone.
Path Parameters
| Name | Type | Description |
|---|---|---|
tenant_id | string | Your tenant ID. |
content_type_id | string | The ID of the content type. |
entry_id | string | The ID of the entry. |
curl -X DELETE "https://api.knitt.co/v1/content/ten_abc123/types/ct_abc123/entries/ent_xyz789" \ -H "Authorization: Bearer YOUR_API_KEY"
Response
Returns a confirmation message.
{
"message": "Entry deleted successfully."
}Last updated: February 7, 2026