Skip to content

Create Content

Creates a new content entry of a given model.

This endpoint is useful for creating content from scripts, migrations, integrations or CI/CD pipelines.

Endpoint

shell
curl -X POST https://api.contentisland.net/api/1.0/content \
--header 'Authorization: Bearer YOUR_WRITE_TOKEN' \
--header 'Content-Type: application/json' \
--data '{ ... }'

Body

The endpoint expects a JSON body with the following structure:

interface CreateContentPayload {
contentType: string; // model name (e.g. "post")
name: string; // display name of the new content entry
content: CreateContentLanguageEntry[];
}
interface CreateContentLanguageEntry {
language?: LanguageCode; // optional — defaults to the project's first language
fields: CreateContentField[];
}
interface CreateContentField {
name: string; // field name as defined in the model
value: any; // field value (type depends on the field)
}
NameDescription
contentTypeThe name of the model the new content belongs to. Must match an existing model in the project.
nameThe human-readable name of the new content entry, used in the dashboard.
contentArray of language entries. Each entry contains the fields to populate for that language. If language is omitted, the project’s default is applied.

Example

shell
curl -X POST https://api.contentisland.net/api/1.0/content \
--header 'Authorization: Bearer YOUR_WRITE_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"contentType": "post",
"name": "My first post",
"content": [
{
"language": "en",
"fields": [
{ "name": "title", "value": "Hello world" },
{ "name": "body", "value": "This was created via the REST API." },
{ "name": "order", "value": 1 }
]
}
]
}'

Response

On success the endpoint returns 201 Created with the ID of the new content:

interface CreateContentResponse {
id: string;
}
{
"id": "660f5b8a3a1c2d4e7f8b9012"
}

Status Codes

CodeDescription
201The content was created successfully. The response body contains the new content id.
400Invalid payload. The response includes an error message and, when applicable, a fieldErrors map describing each problem.
401Unauthorized. The token is missing, malformed or expired.
403Forbidden. The token does not have write permissions — use a Write Token.
404The provided contentType does not match any model in the project.
500Internal server error. An error occurred while processing the request.