Skip to main content
POST
/
api
/
v1
/
collections
Create Collection
curl --request POST \
  --url https://api.example.com/api/v1/collections \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "schema": [
    {
      "name": "<string>",
      "type": "<string>",
      "required": false,
      "default": "<unknown>",
      "unique": false,
      "options": {},
      "collection": "<string>",
      "on_delete": "<string>",
      "pii": false,
      "mask_type": "<string>"
    }
  ]
}
'
{
  "id": "<string>",
  "name": "<string>",
  "table_name": "<string>",
  "schema": [
    {
      "name": "<string>",
      "type": "<string>",
      "required": false,
      "default": "<unknown>",
      "unique": false,
      "options": {},
      "collection": "<string>",
      "on_delete": "<string>",
      "pii": false,
      "mask_type": "<string>"
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Headers

authorization
string | null

Body

application/json

Request body for creating a new collection.

name
string
required

Collection name (3-64 chars, alphanumeric + underscores)

Required string length: 3 - 64
schema
FieldDefinition · object[]
required

List of field definitions (at least one required)

Minimum array length: 1

Response

Successful Response

Response for a created collection.

id
string
required

Collection ID (UUID)

name
string
required

Collection name

table_name
string
required

Physical table name in database

schema
SchemaFieldResponse · object[]
required

Collection schema

created_at
string<date-time>
required

When the collection was created

updated_at
string<date-time>
required

When the collection was last updated