Skip to content

One collection and its field schema

GET
/collections/{collection}
curl --request GET \
--url http://localhost:3000/api/v1/collections/example
collection
required
string
/^[a-z][a-z0-9-]*$/

The collection.

Media typeapplication/json
object
collection
required
object
name
required
string
label
required
string
labelSingular
required
string
titleField
required
string
path
required

The site path of a document, with {slug} in place of the slug.

string
fields
required
object
key
additional properties

A field definition, as in the config file. array and group have nested fields.

object
type
required
string
Allowed values: text textarea slug number boolean select date url media richText tags array blocks group relation
label
string
description
string
required
boolean
to

For a relation field: the collection of the target documents.

string
multiple

For a relation field: a list of documents instead of one.

boolean
maxItems

For a relation, tags or array field: the maximum number of items.

integer
>= 1
key
additional properties
any

Example

{
"collection": {
"path": "/blog/{slug}",
"fields": {
"additionalProperty": {
"type": "text"
}
}
}
}
ETag
string

Send it back in If-None-Match to get a 304.

The ETag in If-None-Match is current. No body.

No such collection, published document or media.

Media typeapplication/json
object
error
required
string
Allowed values: bad_request invalid_token not_found method_not_allowed rate_limited internal moved unavailable cursor_expired
message
required
string

Example

{
"error": "bad_request"
}

Too many requests from this address.

Media typeapplication/json
object
error
required
string
Allowed values: bad_request invalid_token not_found method_not_allowed rate_limited internal moved unavailable cursor_expired
message
required
string

Example

{
"error": "bad_request"
}
Retry-After
integer