Content

Content types and entries endpoints

Content

Create, read, update, and delete content types and entries.

GET/v1/content/{tenant_id}/types

List Content Types

Retrieve all content types defined in your tenant.

Requires API Key

Path Parameters

NameTypeDescription
tenant_idstringYour tenant ID.

Query Parameters

NameTypeDefaultDescription
pageinteger1Page number for pagination.
per_pageinteger25Number 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
  }
}
GET/v1/content/{tenant_id}/types/{content_type_id}

Get Content Type

Retrieve a single content type by its ID.

Requires API Key

Path Parameters

NameTypeDescription
tenant_idstringYour tenant ID.
content_type_idstringThe 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"
  }
}
POST/v1/content/{tenant_id}/types

Create Content Type

Create a new content type with a name, slug, and field definitions.

Requires API Key

Path Parameters

NameTypeDescription
tenant_idstringYour tenant ID.

Request Body

NameTypeRequiredDescription
namestringYesDisplay name for the content type.
slugstringNoURL-friendly slug. Auto-generated from name if omitted.
fieldsarrayYesArray 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"
  }
}
PUT/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.

Requires API Key

Path Parameters

NameTypeDescription
tenant_idstringYour tenant ID.
content_type_idstringThe ID of the content type.

Request Body

NameTypeRequiredDescription
namestringNoNew display name.
slugstringNoNew slug.
fieldsarrayNoUpdated 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"
  }
}
DELETE/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.

Requires API Key

This permanently deletes all entries associated with this content type.

Path Parameters

NameTypeDescription
tenant_idstringYour tenant ID.
content_type_idstringThe 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."
}
GET/v1/content/{tenant_id}/types/{content_type_id}/entries

List Entries

Retrieve all entries for a given content type. Supports pagination, filtering, and sorting.

Requires API Key

Path Parameters

NameTypeDescription
tenant_idstringYour tenant ID.
content_type_idstringThe ID of the content type.

Query Parameters

NameTypeDefaultDescription
pageinteger1Page number.
per_pageinteger25Results per page (max 100).
sortstringField to sort by. Prefix with - for descending.
filter[field]stringFilter entries by field value.
searchstringFull-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
  }
}
GET/v1/content/{tenant_id}/types/{content_type_id}/entries/{entry_id}

Get Entry

Retrieve a single entry by its ID.

Requires API Key

Path Parameters

NameTypeDescription
tenant_idstringYour tenant ID.
content_type_idstringThe ID of the content type.
entry_idstringThe 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"
  }
}
POST/v1/content/{tenant_id}/types/{content_type_id}/entries

Create Entry

Create a new entry for a content type.

Requires API Key

Path Parameters

NameTypeDescription
tenant_idstringYour tenant ID.
content_type_idstringThe ID of the content type.

Request Body

NameTypeRequiredDescription
fieldsobjectYesAn object of field values matching the content type schema.
statusstringNoEntry 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"
  }
}
PATCH/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.

Requires API Key

Path Parameters

NameTypeDescription
tenant_idstringYour tenant ID.
content_type_idstringThe ID of the content type.
entry_idstringThe ID of the entry.

Request Body

NameTypeRequiredDescription
fieldsobjectNoObject of field values to update.
statusstringNoNew 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"
  }
}
DELETE/v1/content/{tenant_id}/types/{content_type_id}/entries/{entry_id}

Delete Entry

Permanently delete an entry. This action cannot be undone.

Requires API Key

Path Parameters

NameTypeDescription
tenant_idstringYour tenant ID.
content_type_idstringThe ID of the content type.
entry_idstringThe 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