The collections and the blocks, with their field schemas
GET
/collections
const url = 'http://localhost:3000/api/v1/collections';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3000/api/v1/collectionsResponses
Section titled “Responses”The schemas.
Media typeapplication/json
object
collections
required
Array<object>
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
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
key
additional properties
any
blocks
required
Array<object>
object
type
required
string
label
required
string
description
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
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
key
additional properties
any
Example
{ "collections": [ { "path": "/blog/{slug}", "fields": { "additionalProperty": { "type": "text" } } } ], "blocks": [ { "fields": { "additionalProperty": { "type": "text" } } } ]}Headers
Section titled “Headers”ETag
string
Send it back in If-None-Match to get a 304.
The ETag in If-None-Match is current. No body.
Too many requests from this address.
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "bad_request"}Headers
Section titled “Headers”Retry-After
integer