Croisa API

API reference

The Croisa API lets an authorized application read a user's websites and CMS collections, poll for new collection entries such as form submissions, and create entries. It is the same API used by the Croisa Zapier integration.

Base URL
https://www.croisa.com/mcp
Protocol
HTTPS, JSON-RPC 2.0
Authentication
OAuth 2.0 code + PKCE (S256)
Scopes
mcp:read, mcp:write

Overview

How the API is shaped

Every API operation is an HTTPS POST to a single endpoint, https://www.croisa.com/mcp, with a JSON-RPC 2.0 body. The operation is named in params.name and its input goes in params.arguments. This is the Model Context Protocol tools/call format, so the same endpoint also serves AI clients (see the MCP guide).

Data is organized as websites, each with collections (typed record lists such as form submissions, orders, bookings, or newsletter sign-ups), each with entries. The operations below cover reading websites and collections, polling new entries, and creating entries.

OperationTypePurpose
list_websitesReadList the websites the authenticated user owns or can access.
list_data_modelsReadList the CMS collections and singletons of one website, with each collection's field schema and entry counts.
describe_data_modelReadDescribe one collection or singleton by ID: its full field schema, field types, required flags, labels, and entry counts..
query_data_entriesReadRead entries from one collection, newest first or in display order, optionally only those created after a timestamp.
create_data_entryWriteCreate one entry in a collection.

Authentication

OAuth 2.0 with PKCE

Croisa uses the OAuth 2.0 authorization code grant with PKCE (S256). The user signs in to Croisa and approves access; your application exchanges the code for an access token and a refresh token. Send the access token as Authorization: Bearer ACCESS_TOKEN on every API request.

Authorization endpointhttps://www.croisa.com/api/v2/oauth/authorize
Token endpointhttps://www.croisa.com/api/v2/oauth/token
Client registrationhttps://www.croisa.com/api/v2/oauth/register
Authorization server metadatahttps://www.croisa.com/.well-known/oauth-authorization-server
Protected resource metadatahttps://www.croisa.com/.well-known/oauth-protected-resource/mcp

1. Register a client (once)

Clients register through dynamic client registration (RFC 7591). The response contains your client_id. Public clients send token_endpoint_auth_method: "none" and use PKCE; confidential clients may use client_secret_basic (the default when the field is left out) or client_secret_post. Request the scopes mcp:read mcp:write; a connection currently gets the same access to the user's websites either way.

POST https://www.croisa.com/api/v2/oauth/register
Content-Type: application/json

{
  "client_name": "My integration",
  "redirect_uris": ["https://example.com/oauth/callback"],
  "grant_types": ["authorization_code", "refresh_token"],
  "response_types": ["code"],
  "token_endpoint_auth_method": "none"
}

2. Send the user to the authorization endpoint

GET https://www.croisa.com/api/v2/oauth/authorize
  ?response_type=code
  &client_id=YOUR_CLIENT_ID
  &redirect_uri=https%3A%2F%2Fexample.com%2Foauth%2Fcallback
  &scope=mcp%3Aread%20mcp%3Awrite
  &state=RANDOM_STATE
  &code_challenge=BASE64URL_SHA256_OF_VERIFIER
  &code_challenge_method=S256

After the user approves, Croisa redirects to redirect_uri with code and state. Codes are single-use.

3. Exchange the code for tokens

POST https://www.croisa.com/api/v2/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code
&code=AUTHORIZATION_CODE
&redirect_uri=https%3A%2F%2Fexample.com%2Foauth%2Fcallback
&client_id=YOUR_CLIENT_ID
&code_verifier=ORIGINAL_CODE_VERIFIER

4. Refresh the access token

POST https://www.croisa.com/api/v2/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=refresh_token
&refresh_token=CURRENT_REFRESH_TOKEN
&client_id=YOUR_CLIENT_ID

Refresh tokens rotate: every refresh returns a new refresh_token and the previous one stops working. Store the new one each time.

Token response

HTTP/1.1 200 OK
Cache-Control: no-store

{
  "access_token": "eyJraWQiOi...",
  "token_type": "Bearer",
  "expires_in": 2700,
  "refresh_token": "q8V0n3...",
  "email": "owner@example.com"
}

expires_in is the remaining access token lifetime in seconds, at most 2700 (45 minutes). Refresh when it expires or when an API call returns HTTP 401. Some clients also receive email, the signed-in account's email, for use as a connection label.

Token errors

HTTP/1.1 400 Bad Request

{
  "error": "invalid_grant",
  "error_description": "Refresh token is invalid or expired"
}

Token endpoint errors follow RFC 6749: invalid_request, invalid_client, invalid_grant (expired or reused code or refresh token, or PKCE failure), unsupported_grant_type, and server_error. They return HTTP 400, except invalid_client on refresh, which returns HTTP 401. On invalid_grant during refresh, the user must reconnect.

Requests and responses

Request envelope

Every operation uses the same request shape. Replace OPERATION_NAME and arguments with the values documented for each operation below.

Request

POST https://www.croisa.com/mcp
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/json
Accept: application/json, text/event-stream

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "OPERATION_NAME",
    "arguments": { }
  }
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [{ "type": "text", "text": "{...same JSON as structuredContent...}" }],
    "structuredContent": { "success": true, ... }
  }
}

The operation result is in result.structuredContent; result.content[0].text holds the same JSON as text. The response examples in this reference show that operation result. Successful results and operation errors have no isError key; check success instead.

Errors

Error handling

There are two kinds of errors.

Authentication errors (HTTP 401)

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer error="invalid_token", error_description="Authentication required", resource_metadata="https://www.croisa.com/.well-known/oauth-protected-resource/mcp"

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [{ "type": "text", "text": "Authentication required" }],
    "isError": true
  }
}

A missing, expired, or invalid access token on tools/call returns HTTP 401 with a WWW-Authenticate header. The text is "Authentication required" when no token is sent and "Invalid or expired token" when the token is rejected. Refresh the token and retry once. The MCP handshake methods (initialize, tools/list) answer without a token.

Operation errors (HTTP 200)

{
  "success": false,
  "error": "Website 20260101T090000-3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c not found or you do not have access to it",
  "error_code": "unauthorized"
}

Validation and permission errors return HTTP 200 with success: false, a human-readable error, and sometimes an error_code. unauthorized means the website does not exist or the user cannot access it. invalid_cursor means a pagination token was malformed: a lastEvaluatedKey in list_websites, or a cursor in query_data_entries that was changed or sent with different sort or since values. Requests are not retried automatically; correct the input and resend.

Read operation · POST /mcp

list_websites

List the websites the authenticated user owns or can access. Most other operations need a websiteId from this response.

Zapier: Used by the connection test and by the hidden "Website" dropdown trigger (website_list), which sends limit=100 and pages with lastEvaluatedKey.

Arguments

ArgumentTypeRequiredDescription
limitintegerNoMaximum websites to return. Default 100, maximum 100.
lastEvaluatedKeystringNoPagination token from the previous response. Pass it unchanged when pagination.hasMore is true.

Example request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_websites",
    "arguments": { "limit": 100 }
  }
}

Example result

{
  "type": "websites",
  "lang": "en",
  "websites": [
    {
      "websiteId": "20260101T090000-3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c",
      "name": "Example Bakery",
      "domain": "www.example-bakery.com",
      "shareUrl": "https://www.example-bakery.com/en?croisa_lang=auto",
      "status": "public",
      "localesArr": ["en", "es"],
      "localesStatus": {
        "en": { "status": "COMPLETED" },
        "es": { "status": "COMPLETED" }
      },
      "createdAt": "2026-01-01T09:00:02.181Z"
    }
  ],
  "pagination": {
    "hasMore": false,
    "count": 1
  }
}

shareUrl is present only for websites with more than one language. When pagination.hasMore is true, pagination.lastEvaluatedKey holds the token for the next page; on the last page the key is left out. A malformed lastEvaluatedKey returns error_code "invalid_cursor".

Read operation · POST /mcp

list_data_models

List the CMS collections and singletons of one website, with each collection's field schema and entry counts. Collections hold repeatable records such as form submissions, orders, bookings, newsletter sign-ups, menu items, or team members.

Zapier: Used by the hidden "Collection" dropdown trigger (collection_list), and by the "Create Collection Entry" action to build its input fields from the chosen collection's fields.

Arguments

ArgumentTypeRequiredDescription
websiteIdstringYesWebsite ID from list_websites.
localestringNoLocale for field labels and help text. Defaults to the website default locale.
includeCountsbooleanNoDefault true. Pass false for a faster schema-only listing; entryCounts, usage, dataId, dataPageUrl and dataPageAccess are then left out.
currentPageIdstringNoEditor use. With currentLocale, usage also includes draft references on that page.
currentLocalestringNoEditor use. See currentPageId.

Example request

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "list_data_models",
    "arguments": { "websiteId": "20260101T090000-3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c" }
  }
}

Example result

{
  "success": true,
  "collections": [
    {
      "collectionId": "col_4adc35440a80",
      "dataId": "col_4adc35440a80",
      "kind": "collection",
      "displayName": "Newsletter sign-ups",
      "description": "People who subscribed through the website footer form.",
      "locale": "en",
      "fields": [
        { "fieldKey": "fullName", "label": "Full name", "type": "string", "required": true, "localized": false, "order": 0 },
        { "fieldKey": "email", "label": "Email", "type": "string", "required": true, "localized": false, "order": 1 },
        { "fieldKey": "marketingConsent", "label": "Marketing consent", "type": "boolean", "required": true, "localized": false, "order": 2 }
      ],
      "entryCounts": { "total": 42, "visible": 0, "hidden": 42 },
      "usage": { "hasLiveFormWrites": true, "hasLiveReadBindings": false }
    }
  ],
  "singletons": [],
  "count": 1
}

The response also contains more usage details, template fields, a view-only dashboard link (dataPageUrl, dataPageAccess) and guidance blocks (keys starting with _) meant for AI clients. Integrations can ignore them.

Read operation · POST /mcp

describe_data_model

Describe one collection or singleton by ID: its full field schema, field types, required flags, labels, and entry counts.

Zapier: Not called by the Zapier integration, which reads the same field schema from list_data_models. Documented for other integrations.

Arguments

ArgumentTypeRequiredDescription
websiteIdstringYesWebsite ID from list_websites.
dataIdstringYesCollection ID (col_...) or singleton ID (sgl_...) from list_data_models.
localestringNoLocale for field labels and help text. Defaults to the website default locale.

Example request

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "describe_data_model",
    "arguments": {
      "websiteId": "20260101T090000-3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c",
      "dataId": "col_4adc35440a80"
    }
  }
}

Example result

{
  "success": true,
  "model": {
    "collectionId": "col_4adc35440a80",
    "kind": "collection",
    "displayName": "Newsletter sign-ups",
    "fields": [
      { "fieldKey": "fullName", "label": "Full name", "type": "string", "required": true },
      { "fieldKey": "email", "label": "Email", "type": "string", "required": true },
      { "fieldKey": "marketingConsent", "label": "Marketing consent", "type": "boolean", "required": true }
    ],
    "entryCounts": { "total": 42, "visible": 0, "hidden": 42 }
  }
}

Field types are string, richText, number, boolean, url, money ({ amountMinor, currency }), image, video, asset, object, and list. An unknown dataId returns success: false.

Read operation · POST /mcp

query_data_entries

Read entries from one collection, newest first or in display order, optionally only those created after a timestamp. Results are paginated with an opaque cursor.

Zapier: Used by the polling trigger "New Collection Entry" (new_collection_entry) with includeHidden=true and limit=100 in the default display order. It follows cursor for up to 10 pages, sorts the entries by createdAt (newest first) itself, and deduplicates on the entry id.

Arguments

ArgumentTypeRequiredDescription
websiteIdstringYesWebsite ID from list_websites.
collectionIdstringYesCollection ID (col_...) from list_data_models.
sortstringNo"display" (default, the collection display order) or "newest" (createdAt descending).
sincestringNoISO-8601 timestamp or date. Returns only entries created strictly after it. No offset means UTC.
includeHiddenbooleanNoDefault true. Hidden entries, such as moderated form submissions, are included. Pass false for published entries only.
limitintegerNoPage size. Default 50, maximum 100.
cursorstringNoContinuation token from the previous response. Send it with the same sort and since values.
localestringNoLocale used to resolve localized values. Defaults to the website default locale.

Example request

{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": {
    "name": "query_data_entries",
    "arguments": {
      "websiteId": "20260101T090000-3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c",
      "collectionId": "col_4adc35440a80",
      "includeHidden": true,
      "limit": 100
    }
  }
}

Example result

{
  "success": true,
  "collection": {
    "collectionId": "col_4adc35440a80",
    "displayName": "Newsletter sign-ups",
    "fields": [ ... ],
    ...
  },
  "items": [
    {
      "id": "ent_9f3c2a71b0de",
      "entryId": "ent_9f3c2a71b0de",
      "fullName": "Ana García",
      "email": "ana@example.com",
      "marketingConsent": true,
      "visibility": "hidden",
      "public": false,
      "order": 41,
      "createdAt": "2026-10-26T08:14:03.512Z",
      "createdAtLocal": "2026-10-26T09:14:03+01:00",
      "updatedAt": "2026-10-26T08:14:03.512Z",
      "locale": "en",
      "provenance": {
        "source": "customSectionForm",
        "actionId": "newsletterSignup",
        "purpose": "newsletter_signup",
        "submittedLocale": "en"
      },
      "shortId": "1B0DE"
    }
  ],
  "count": 1,
  "limit": 100,
  "cursor": null,
  "includeHidden": true,
  "visibleCount": 0,
  "hiddenCount": 1,
  "timeZone": "Europe/Madrid",
  "timeZoneSource": "business",
  "dataPageUrl": "https://www.croisa.com/en/data?id=...&c=col_4adc35440a80",
  "dataPageAccess": "view_only"
}

Each item carries the collection's field values keyed by fieldKey plus the system fields shown above. visibility is "visible" (published on the website) or "hidden", and public is the same as a boolean. createdAt is UTC; createdAtLocal is the same moment in timeZone, the business time zone. provenance and shortId are present only on form-created entries; shortId is a short display code, not a unique key. collection holds the full collection metadata. With sort="newest" or since, the result also echoes sort and since and adds skippedHiddenCount and scanLimitReached (true when the call stopped at its read limit before the end, so a short page with a non-null cursor does not mean there are no more entries). Keep paging while cursor is non-null. An invalid or mismatched cursor returns error_code "invalid_cursor".

Write operation · POST /mcp

create_data_entry

Create one entry in a collection. values is an object keyed by the collection's fieldKey names. Localized text is stored for the given locale and queued for translation into the website's other languages.

Zapier: Used by the action "Create Collection Entry" (create_collection_entry). Each dynamic field__<fieldKey> input becomes values.<fieldKey>; locale defaults to "en". The action returns editableItem plus entryId and collectionId.

Arguments

ArgumentTypeRequiredDescription
websiteIdstringYesWebsite ID from list_websites.
collectionIdstringYesCollection ID (col_...) from list_data_models.
localestringYesLanguage code the values are written in, for example "en". Use one of the website's languages (localesArr in list_websites).
valuesobjectYesField values keyed by fieldKey. Required fields must be present and values must match the field type.
orderintegerNoPosition in the collection display order. Defaults to the end.

Example request

{
  "jsonrpc": "2.0",
  "id": 5,
  "method": "tools/call",
  "params": {
    "name": "create_data_entry",
    "arguments": {
      "websiteId": "20260101T090000-3f2a9c1e-7b4d-4e8a-9c21-5d6e7f8a9b0c",
      "collectionId": "col_4adc35440a80",
      "locale": "en",
      "values": {
        "fullName": "Ana García",
        "email": "ana@example.com",
        "marketingConsent": true
      }
    }
  }
}

Example result

{
  "success": true,
  "collectionId": "col_4adc35440a80",
  "entryId": "ent_9f3c2a71b0de",
  "items": [
    {
      "id": "ent_9f3c2a71b0de",
      "entryId": "ent_9f3c2a71b0de",
      "fullName": "Ana García",
      "email": "ana@example.com",
      "marketingConsent": true,
      "visibility": "visible",
      "public": true,
      "order": 42,
      "createdAt": "2026-10-26T08:14:03.512Z",
      "updatedAt": "2026-10-26T08:14:03.512Z",
      "locale": "en"
    }
  ],
  "editableItem": {
    "fullName": "Ana García",
    "email": "ana@example.com",
    "marketingConsent": true
  },
  "missingOptionalFields": [],
  "baseRevision": "2026-10-26T08:14:03.512Z"
}

The result also contains translation and publishing status keys (touchedLocalizedFields, localizedValuePatches, and keys starting with _) that integrations can ignore. success, collectionId and entryId are always present when the entry was saved; if a follow-up step fails after the save, items and editableItem can be missing, so do not require them. A missing required field, an unknown fieldKey, or a value of the wrong type returns success: false with an error message describing the field.

Need help with the API? Contact support@croisa.com. The full list of operations available to AI clients is in the MCP guide.

    We're Here to Help

    Send us an email and we'll get back to you as soon as possible.

    Send Email