Records

get
Get Records by Collection

https://app.fuchsiacms.com/api/records/collection/:collectionId
This endpoint allows you to query records in a collection
Request
Response
Request
Path Parameters
collectionId
required
string
The ID of the collection to query records within
Query Parameters
loadDefaults
optional
boolean
If the field has a default value attached and the record value is empty, then the default will be returned. Set loadDefaults to false to ignore defaults and just return empty values. Default: true
filter
optional
array
An array of filters to query records by their data. Example: `?filter=name:==:bob&filter=age:<=:45`. See below for more filter examples.
convertMarkdown
optional
boolean
If set to true, any record that contains markdown will automatically be converted to HTML. Default: false
includeDrafts
optional
boolean
If set to true, will return records that are unpublished. Default: false
loadReferences
optional
boolean
If set to true, any records that contain a reference to another record will load the full record referenced inline. Default: false.
loadAssets
optional
boolean
If set to true, any records that contain a media Asset will load the full Asset record inline. Default: false
skip
optional
integer
The number of records to skip. Used with take query param to create pagination. Default: 0
take
optional
integer
The max number of records to return. Default: 25
key
required
string
The Project API key
Response
200: OK
List of records
[
{
id: "string",
projectId: "string",
modelId: "string",
collectionId: "string",
published: "boolean",
data: {
// `data` will hold all the custom data in the record
// Every field in the model will have it's codeName as
// a key and any value that was entered as the value
[modelFieldCodeNames]: "any value"
},
createdAt: "int64",
updatedAt: "int64"
}
]
400: Bad Request
Malformed Request
"message"
401: Unauthorized
Invalid API key
"Invalid API key"

Filtering data

Using the Get Records by Collection endpoint, you can query your data with flexible operators. The format must always be in the format of filter=fieldCodeName:operand:value. You can chain as many filters as you like by including more filter query params in the request. Ex: ?filter=name:==:jason&filter=age:<=:70&filter=tall:==:true

Operands

These are all the supported operands for filtering data.

Operand

Description

==

Equals

<=

Less Than or Equals

>=

Greater Than or Equals

<

Less Than

>

Greater Than

!=

Not Equals

post
Create Record

https://app.fuchsiacms.com/api/records/record
Create a new record. Whichever model is associated to it - then the `data` field will have to be the same format as the model describes.
Request
Response
Request
Query Parameters
key
required
string
The project API key
Body Parameters
data
required
object
The data that respects the form of the model. Every field in the model should have a key in this data object.
published
required
boolean
If the record should be published right away, set to True, otherwise set to False to be unpublished.
collectionId
required
string
The ID of the collection to insert the record into. The collection must also have the same Model ID as the record Model ID.
modelId
required
string
The ID of the model that represents the structure of the data fieldc
projectId
required
string
The project ID
Response
200: OK
The successfully saved record object
{
id: "string",
projectId: "string",
modelId: "string",
collectionId: "string",
published: "boolean",
data: {
// `data` will hold all the custom data in the record
// Every field in the model will have it's codeName as
// a key and any value that was entered as the value
[modelFieldCodeNames]: "any value"
},
createdAt: "int64",
updatedAt: "int64"
}
400: Bad Request
Malformed request
"message"
401: Unauthorized
Invalid API key
"Invalid API key"

patch
Modify Record

https://app.fuchsiacms.com/api/records/record
Modify an existing Record
Request
Response
Request
Query Parameters
key
required
string
The project API key
Body Parameters
data
required
object
Data object that respects the model structure
published
required
boolean
If the record should be published, set to True, otherwise False
id
required
string
The ID of the record to modify
Response
200: OK
Count of objects successfully modifed
1
400: Bad Request
Malformed Request
"message"
401: Unauthorized
Invalid API key
"Invalid API key"

delete
Delete Record

https://app.fuchsiacms.com/api/records/record/:recordId
Delete a record. Warning: this is a destructive operation that can not be recovered.
Request
Response
Request
Path Parameters
recordId
required
string
The ID of the record to delete
Query Parameters
key
required
string
The project API key
Response
200: OK
Returns the ID of the record if successfully deleted
"<Record ID>"
400: Bad Request
Malformed Request
"message"
401: Unauthorized
Invalid API key
"Invalid API key"