API reference/Collections
Add a record
Try itAdds a record to the end of a collection. published=true (the default) puts its page on the site at once — no publish_site. Price fields are integer cents.
POST
/api/v1/sites/{site_id}/collections/{collection_id}/recordsAuthentication
An API key as Authorization: Bearer or x-api-key. It needs the collections:write scope — make collections and add, change and delete records (live at once).
collections:writeChanges the live siteIdempotency-Key requiredMCP tool: create_collection_record
Parameters
Named placeholders go in the path; the rest in a JSON body.
site_idstringPath · required- The site's id.1 to 100 characters
collection_idstringPath · required- The collection's id.1 to 100 characters
titlestringBody · required- 1 to 160 characters
slugstringBody · optional- The web address after /{collection}/. Omitted = made from the title.At most 80 characters
summarystringBody · optional- One short line for cards and link previews.At most 300 characters
bodystringBody · optional- The details as plain text (blank line = new paragraph).At most 12000 characters
image_urlstring | nullBody · optional- A /media/… address from the picture library, or null.At most 500 characters
image_altstringBody · optional- What the picture shows.At most 200 characters
valuesobjectBody · optional- By field key. Price fields in integer CENTS, numbers as numbers, dates YYYY-MM-DD; null or "" clears one.
link_urlstring | nullBody · optional- A button link: https://… or a /path on the site.At most 500 characters
link_labelstring | nullBody · optional- At most 40 characters
publishedbooleanBody · optional- true = on the site at once; false = hidden.Default
true
Response
201 with JSON on success (schema on the right). Errors use the standard envelope; a retry with the same Idempotency-Key gets the first answer back (how retries work).
curl -X POST 'https://websites.workflowcorp.com/api/v1/sites/SITE_ID/collections/COLLECTION_ID/records' \
-H "Authorization: Bearer $WEBSITEBUDDY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"title":"Linden Craftsman","summary":"A 1924 craftsman with a deep front porch, two blocks from Main Street.","values":{"price":48900000,"bedrooms":3,"bathrooms":2,"neighborhood":"Old Town"},"published":true}'{
"site_id": "SITE_ID",
"collection_id": "COLLECTION_ID",
"title": "Linden Craftsman",
"summary": "A 1924 craftsman with a deep front porch, two blocks from Main Street.",
"values": {
"price": 48900000,
"bedrooms": 3,
"bathrooms": 2,
"neighborhood": "Old Town"
},
"published": true
}{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"collection_id": {
"type": "string"
},
"title": {
"type": "string"
},
"slug": {
"type": "string"
},
"summary": {
"type": "string"
},
"body": {
"type": "string",
"description": "Plain text (blank line = new paragraph)."
},
"image_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"image_alt": {
"type": "string"
},
"values": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"description": "By field key; price fields in integer cents."
},
"values_words": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
},
"description": "The same values as visitors read them (\"$489,000\")."
},
"link_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"link_label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"position": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"published": {
"type": "boolean"
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The record's page on the live site — null while hidden."
},
"is_sample": {
"type": "boolean"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"required": [
"id",
"collection_id",
"title",
"slug",
"summary",
"body",
"image_url",
"image_alt",
"values",
"values_words",
"link_url",
"link_label",
"position",
"published",
"url",
"is_sample",
"created_at",
"updated_at"
],
"additionalProperties": false
}