Skip to content

Models

APIs for defining content models and components. Models define the structure of your content; components are reusable building blocks.

List Models GET

Returns the list of content models defined in the project.

GET /{project}/content-types/models

Path Parameters

NameTypeRequiredDescription
projectstringYes-

Query Parameters

NameTypeRequiredDescription
systembooleanNo-

Response (200 OK)

json
[
  {
    "id": "string",
    "name": "string",
    "key": "string",
    "description": "string",
    "type": "model",
    "attributes": [
      {
        "key": "string",
        "label": "string",
        "name": "string",
        "hint": "string",
        "order": 0,
        "type": "string",
        "localizable": true,
        "hidden": true,
        "readOnly": true,
        "required": true
      }
    ],
    "createdAt": "2024-01-15T12:00:00Z",
    "createdBy": "string",
    "modifiedAt": "2024-01-15T12:00:00Z",
    "modifiedBy": "string",
    "enableStageMode": true,
    "isSingle": true,
    "system": true,
    "localizable": true,
    "properties": {
      "icon": "string",
      "fieldsets": [],
      "links": []
    },
    "filters": [
      {
        "name": "string",
        "operators": [],
        "key": "string",
        "fieldType": "boolean"
      }
    ]
  }
]

cURL Example

bash
curl -X GET "https://my-project.atlascms.io/{project}/content-types/models" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Create Model POST

Creates a new content model with the specified fields and configuration.

POST /{project}/content-types/models

Path Parameters

NameTypeRequiredDescription
projectstringYes-

Request Body

json
{
  "key": "string",
  "name": "string",
  "description": "string",
  "isSingle": true,
  "localizable": true,
  "enableStageMode": true,
  "attributes": [
    {
      "key": "string",
      "label": "string",
      "name": "string",
      "hint": "string",
      "order": 0,
      "type": "string",
      "localizable": true,
      "hidden": true,
      "readOnly": true,
      "required": true
    }
  ],
  "properties": {
    "icon": "string",
    "fieldsets": [
      {
        "key": "string",
        "name": "string",
        "description": "string",
        "collapsed": true,
        "fields": []
      }
    ],
    "links": [
      {
        "key": "string",
        "value": "string"
      }
    ]
  }
}

Response (200 OK)

json
{
  "result": "string"
}

cURL Example

bash
curl -X POST "https://my-project.atlascms.io/{project}/content-types/models" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"key":"string","name":"string","description":"string","isSingle":true,"localizable":true,"enableStageMode":true,"attributes":[{"key":"string","label":"string","name":"string","hint":"string","order":0,"type":"string","localizable":true,"hidden":true,"readOnly":true,"required":true}],"properties":{"icon":"string","fieldsets":[{"key":"string","name":"string","description":"string","collapsed":true,"fields":[]}],"links":[{"key":"string","value":"string"}]}}'

Get Model GET

Retrieves a single model by ID including its field definitions.

GET /{project}/content-types/models/{id}

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

Response (200 OK)

json
{
  "id": "string",
  "name": "string",
  "key": "string",
  "description": "string",
  "type": "model",
  "attributes": [
    {
      "key": "string",
      "label": "string",
      "name": "string",
      "hint": "string",
      "order": 0,
      "type": "string",
      "localizable": true,
      "hidden": true,
      "readOnly": true,
      "required": true
    }
  ],
  "createdAt": "2024-01-15T12:00:00Z",
  "createdBy": "string",
  "modifiedAt": "2024-01-15T12:00:00Z",
  "modifiedBy": "string",
  "enableStageMode": true,
  "isSingle": true,
  "system": true,
  "localizable": true,
  "properties": {
    "icon": "string",
    "fieldsets": [
      {
        "key": "string",
        "name": "string",
        "description": "string",
        "collapsed": true,
        "fields": []
      }
    ],
    "links": [
      {
        "key": "string",
        "value": "string"
      }
    ]
  },
  "filters": [
    {
      "name": "string",
      "operators": [],
      "key": "string",
      "fieldType": "boolean"
    }
  ]
}

cURL Example

bash
curl -X GET "https://my-project.atlascms.io/{project}/content-types/models/item-id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Update Model PUT

Updates an existing model. Changes apply immediately to content.

PUT /{project}/content-types/models/{id}

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

Request Body

json
{
  "name": "string",
  "description": "string",
  "localizable": true,
  "enableStageMode": true,
  "attributes": [
    {
      "key": "string",
      "label": "string",
      "name": "string",
      "hint": "string",
      "order": 0,
      "type": "string",
      "localizable": true,
      "hidden": true,
      "readOnly": true,
      "required": true
    }
  ],
  "properties": {
    "icon": "string",
    "fieldsets": [
      {
        "key": "string",
        "name": "string",
        "description": "string",
        "collapsed": true,
        "fields": []
      }
    ],
    "links": [
      {
        "key": "string",
        "value": "string"
      }
    ]
  }
}

Response (200 OK)

json
{
  "result": "string"
}

cURL Example

bash
curl -X PUT "https://my-project.atlascms.io/{project}/content-types/models/item-id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"name":"string","description":"string","localizable":true,"enableStageMode":true,"attributes":[{"key":"string","label":"string","name":"string","hint":"string","order":0,"type":"string","localizable":true,"hidden":true,"readOnly":true,"required":true}],"properties":{"icon":"string","fieldsets":[{"key":"string","name":"string","description":"string","collapsed":true,"fields":[]}],"links":[{"key":"string","value":"string"}]}}'

Delete Model DELETE

Deletes a model and all its content. This action cannot be undone.

DELETE /{project}/content-types/models/{id}

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

cURL Example

bash
curl -X DELETE "https://my-project.atlascms.io/{project}/content-types/models/item-id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

List Components GET

Returns the list of reusable components defined in the project.

GET /{project}/content-types/components

Path Parameters

NameTypeRequiredDescription
projectstringYes-

Response (200 OK)

json
[
  {
    "id": "string",
    "projectId": "string",
    "name": "string",
    "key": "string",
    "description": "string",
    "type": "model",
    "attributes": [
      {
        "key": "string",
        "label": "string",
        "name": "string",
        "hint": "string",
        "order": 0,
        "type": "string",
        "localizable": true,
        "hidden": true,
        "readOnly": true,
        "required": true
      }
    ],
    "createdAt": "2024-01-15T12:00:00Z",
    "createdBy": "string",
    "modifiedAt": "2024-01-15T12:00:00Z",
    "modifiedBy": "string"
  }
]

cURL Example

bash
curl -X GET "https://my-project.atlascms.io/{project}/content-types/components" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Create Component POST

Creates a new content component that can be embedded in models.

POST /{project}/content-types/components

Path Parameters

NameTypeRequiredDescription
projectstringYes-

Request Body

json
{
  "key": "string",
  "name": "string",
  "description": "string",
  "attributes": [
    {
      "key": "string",
      "label": "string",
      "name": "string",
      "hint": "string",
      "order": 0,
      "type": "string",
      "localizable": true,
      "hidden": true,
      "readOnly": true,
      "required": true
    }
  ]
}

Response (200 OK)

json
{
  "result": "string"
}

cURL Example

bash
curl -X POST "https://my-project.atlascms.io/{project}/content-types/components" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"key":"string","name":"string","description":"string","attributes":[{"key":"string","label":"string","name":"string","hint":"string","order":0,"type":"string","localizable":true,"hidden":true,"readOnly":true,"required":true}]}'

Get Component GET

Retrieves a single component by ID including its field definitions.

GET /{project}/content-types/components/{id}

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

Response (200 OK)

json
{
  "id": "string",
  "projectId": "string",
  "name": "string",
  "key": "string",
  "description": "string",
  "type": "model",
  "attributes": [
    {
      "key": "string",
      "label": "string",
      "name": "string",
      "hint": "string",
      "order": 0,
      "type": "string",
      "localizable": true,
      "hidden": true,
      "readOnly": true,
      "required": true
    }
  ],
  "createdAt": "2024-01-15T12:00:00Z",
  "createdBy": "string",
  "modifiedAt": "2024-01-15T12:00:00Z",
  "modifiedBy": "string"
}

cURL Example

bash
curl -X GET "https://my-project.atlascms.io/{project}/content-types/components/item-id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Update Component PUT

Updates an existing component.

PUT /{project}/content-types/components/{id}

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

Request Body

json
{
  "name": "string",
  "description": "string",
  "attributes": [
    {
      "key": "string",
      "label": "string",
      "name": "string",
      "hint": "string",
      "order": 0,
      "type": "string",
      "localizable": true,
      "hidden": true,
      "readOnly": true,
      "required": true
    }
  ]
}

Response (200 OK)

json
{
  "result": "string"
}

cURL Example

bash
curl -X PUT "https://my-project.atlascms.io/{project}/content-types/components/item-id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"name":"string","description":"string","attributes":[{"key":"string","label":"string","name":"string","hint":"string","order":0,"type":"string","localizable":true,"hidden":true,"readOnly":true,"required":true}]}'

Delete Component DELETE

Deletes a component. Models using it must be updated first.

DELETE /{project}/content-types/components/{id}

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

cURL Example

bash
curl -X DELETE "https://my-project.atlascms.io/{project}/content-types/components/item-id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Atlas CMS Documentation