One collection and its field schema
GET
/collections/{collection}
const url = 'http://localhost:3000/api/v1/collections/example';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/collections/exampleParameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”collection
required
string
Responses
Section titled “Responses”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
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
{ "collection": { "path": "/blog/{slug}", "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.
No such collection, published document or media.
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "bad_request"}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