Skip to content
API reference/Collections

Change a collection

Try it

Changes a collection's name, address, intro or fields. Only what you send changes; sending fields replaces the list (keep a field's key to keep its values).

PATCH/api/v1/sites/{site_id}/collections/{collection_id}

Authentication

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 optionalMCP tool: update_collection

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
namestringBody · optional
"Homes for sale".2 to 60 characters
item_namestringBody · optional
What ONE record is called ("Home").1 to 40 characters
slugstringBody · optional
The web address (3–48 lowercase letters, numbers, dashes). Omitted = made from the name. Not blog, events, store, cart, privacy or search.At most 48 characters
descriptionstringBody · optional
The intro on the list page.At most 600 characters
fieldsarray of objectBody · optional
Up to 8 fields every record has. Sending fields REPLACES the list (keep keys to keep values).

Response

200 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
curl -X PATCH 'https://websites.workflowcorp.com/api/v1/sites/SITE_ID/collections/COLLECTION_ID' \
  -H "Authorization: Bearer $WEBSITEBUDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Example arguments
{
  "site_id": "SITE_ID",
  "collection_id": "COLLECTION_ID"
}
Response schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "The web address: /{slug} lists the records, /{slug}/{record} is one."
    },
    "item_name": {
      "type": "string",
      "description": "What ONE record is called (\"Home\")."
    },
    "description": {
      "type": "string"
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Stable key the record's values use."
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "text",
              "number",
              "price",
              "date",
              "link"
            ],
            "description": "text, number, price (integer cents), date (YYYY-MM-DD) or link."
          },
          "in_list": {
            "type": "boolean",
            "description": "Shown on the cards and in lists, not only on the record's page."
          }
        },
        "required": [
          "key",
          "label",
          "kind",
          "in_list"
        ],
        "additionalProperties": false
      }
    },
    "records": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "url": {
      "type": "string",
      "description": "The list on the live site (a site page with the same address wins)."
    },
    "is_sample": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "name",
    "slug",
    "item_name",
    "description",
    "fields",
    "records",
    "url",
    "is_sample",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}