{
    "openapi": "3.1.0",
    "info": {
        "title": "TGCPilot Public API",
        "version": "1.0.0",
        "description": "Machine-readable OpenAPI 3.1 specification for the TGCPilot Public API.\n\n## Events and automation\n\nSix trigger events can be delivered to a webhook endpoint: `message.inbound`, `conversation.new`, `conversation.assigned`, `conversation.closed`, `contact.created` and `contact.updated`. Their envelopes, schemas and samples are published with the integration definitions; every trigger event carries `data.resource` and an `origin` block (`surface`, `connection_id`, `api_key_id`, `correlation_id`).\n\n**Delivery is at-least-once.** Deduplicate by the envelope `id`, which is stable per occurrence. An event can arrive late, within 24 hours of the change; notifications that could not be delivered within 24 hours are dropped and never replayed, so an outage or suspension can cause missed or stale automations.\n\n**Integration-owned subscriptions.** A key issued to a Make or Zapier connection subscribes through `/webhook-endpoints`: one event per subscription, an immutable URL, soft removal, and an idempotent subscribe for the same URL and event. Member-created endpoints keep their own queue, retries and behaviour.\n\n**Loop protection.** `contact.updated` for a change made by the subscribing connection is not delivered while `ignore_own_changes` is true, and a contact that changes more than 10 times a minute for one subscription is suppressed and flagged for attention.\n\n**What emits.** Single-contact create, edit, tag, consent, number and archive changes emit contact events; imports, audience uploads, bulk tagging, history import and coexistence sync emit nothing. Every conversation closed emits its own `conversation.closed`, including each one closed by a bulk close."
    },
    "servers": [
        {
            "url": "https://tgcpilot.com/api/v1",
            "description": "Production API Server"
        }
    ],
    "paths": {
        "/messages": {
            "post": {
                "operationId": "api.v1.messages.store",
                "summary": "Send a template or free-form WhatsApp message.",
                "description": "Queue text or an approved template on an existing conversation or on a named or default channel account. WhatsApp text requires an open service window.\n\n**Required Scope**: `messages:send`",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "conversation_id": {
                                                    "type": "string"
                                                },
                                                "direction": {
                                                    "type": "string",
                                                    "enum": [
                                                        "inbound",
                                                        "outbound"
                                                    ]
                                                },
                                                "channel": {
                                                    "type": "object",
                                                    "properties": {
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "account_id": {
                                                            "type": "string"
                                                        },
                                                        "account_label": {
                                                            "type": "string"
                                                        },
                                                        "account_removed": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "type",
                                                        "account_id",
                                                        "account_label",
                                                        "account_removed"
                                                    ]
                                                },
                                                "provider_message_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "quoted_message_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "object"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "ingestion_mode": {
                                                    "type": "string",
                                                    "enum": [
                                                        "live",
                                                        "history",
                                                        "echo"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "received",
                                                        "queued",
                                                        "sending",
                                                        "sent",
                                                        "delivered",
                                                        "read",
                                                        "failed",
                                                        "delivery_unconfirmed"
                                                    ]
                                                },
                                                "status_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "provider_error_class": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "failure_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sent_via": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "type": {
                                                            "type": "string",
                                                            "enum": [
                                                                "api_key",
                                                                "user",
                                                                "system"
                                                            ]
                                                        },
                                                        "id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "conversation_id",
                                                "direction",
                                                "status",
                                                "created_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "id": "9012",
                                                "conversation_id": "77",
                                                "direction": "outbound",
                                                "channel": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "type": "whatsapp",
                                                    "account_id": "01JBX6C4D8F1G5H9J2K6M0NPQR",
                                                    "account_label": "+965 5000 0111",
                                                    "account_removed": false
                                                },
                                                "provider_message_id": null,
                                                "quoted_message_id": null,
                                                "type": "text",
                                                "content": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "text": "Your order #1042 has shipped."
                                                },
                                                "status": "queued",
                                                "status_reason": null,
                                                "provider_error_class": null,
                                                "failure_reason": null,
                                                "sent_via": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "type": "api_key",
                                                    "id": "01JBX6C4D8F1G5H9J2K6M0NPQR",
                                                    "name": "Zapier \u00b7 Sales team"
                                                },
                                                "source": null,
                                                "ingestion_mode": "live",
                                                "created_at": "2026-10-18T09:30:00+03:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed, channel_required, channel_account_required, channel_account_mismatch, channel_account_unavailable, channel_account_revoked, channel_account_removed, contact_archived, template_unusable, template_paused, unsupported_capability:template, unsupported_capability:text, service_window_closed, contact_opted_out",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Error: subscription_gated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error: payload_too_large",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "messages:send",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "conversation_id": {
                                        "type": "integer",
                                        "minimum": 1
                                    },
                                    "channel": {
                                        "type": "string"
                                    },
                                    "channel_account_id": {
                                        "type": "string",
                                        "description": "Public channel account ULID."
                                    },
                                    "to": {
                                        "type": "string",
                                        "description": "Recipient address on the selected channel."
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "text",
                                            "template"
                                        ]
                                    },
                                    "template": {
                                        "type": "object",
                                        "properties": {
                                            "name": {
                                                "type": "string"
                                            },
                                            "language": {
                                                "type": "string"
                                            },
                                            "variables": {
                                                "type": "object",
                                                "description": "Values keyed by variable position. A number is accepted and sent as its string form.",
                                                "additionalProperties": {
                                                    "type": [
                                                        "string",
                                                        "number"
                                                    ]
                                                }
                                            }
                                        },
                                        "required": [
                                            "name",
                                            "language"
                                        ]
                                    },
                                    "text": {
                                        "type": "string"
                                    }
                                },
                                "oneOf": [
                                    {
                                        "required": [
                                            "conversation_id"
                                        ],
                                        "not": {
                                            "required": [
                                                "to"
                                            ]
                                        }
                                    },
                                    {
                                        "required": [
                                            "channel",
                                            "to"
                                        ],
                                        "not": {
                                            "required": [
                                                "conversation_id"
                                            ]
                                        }
                                    }
                                ],
                                "required": [
                                    "type"
                                ]
                            },
                            "examples": {
                                "default": {
                                    "value": {
                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                        "channel": "whatsapp",
                                        "type": "text",
                                        "to": "+96555000111",
                                        "text": "\u0645\u0631\u062d\u0628\u0627 \u0641\u0627\u0637\u0645\u0629\u060c \u0637\u0644\u0628\u0643 \u0641\u064a \u0627\u0644\u0637\u0631\u064a\u0642."
                                    }
                                },
                                "template": {
                                    "value": {
                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                        "channel": "whatsapp",
                                        "type": "template",
                                        "to": "+96555000111",
                                        "template": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "name": "order_update",
                                            "language": "ar",
                                            "variables": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "1": "Fatima",
                                                "2": "KWD 12.500"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/messages/{id}": {
            "get": {
                "operationId": "api.v1.messages.show",
                "summary": "Retrieve a message by ID.",
                "description": "Fetch delivery status and details for an outbound or inbound message in this workspace.\n\n**Required Scope**: `messages:read`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "conversation_id": {
                                                    "type": "string"
                                                },
                                                "direction": {
                                                    "type": "string",
                                                    "enum": [
                                                        "inbound",
                                                        "outbound"
                                                    ]
                                                },
                                                "channel": {
                                                    "type": "object",
                                                    "properties": {
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "account_id": {
                                                            "type": "string"
                                                        },
                                                        "account_label": {
                                                            "type": "string"
                                                        },
                                                        "account_removed": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "type",
                                                        "account_id",
                                                        "account_label",
                                                        "account_removed"
                                                    ]
                                                },
                                                "provider_message_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "quoted_message_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "content": {
                                                    "type": "object"
                                                },
                                                "source": {
                                                    "type": "string"
                                                },
                                                "ingestion_mode": {
                                                    "type": "string",
                                                    "enum": [
                                                        "live",
                                                        "history",
                                                        "echo"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "received",
                                                        "queued",
                                                        "sending",
                                                        "sent",
                                                        "delivered",
                                                        "read",
                                                        "failed",
                                                        "delivery_unconfirmed"
                                                    ]
                                                },
                                                "status_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "provider_error_class": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "failure_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sent_via": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "type": {
                                                            "type": "string",
                                                            "enum": [
                                                                "api_key",
                                                                "user",
                                                                "system"
                                                            ]
                                                        },
                                                        "id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "conversation_id",
                                                "direction",
                                                "status",
                                                "created_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "messages:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/contacts": {
            "get": {
                "operationId": "api.v1.contacts.index",
                "summary": "List contacts with filters and cursor pagination.",
                "description": "Retrieve a cursor-paginated list of contacts in this workspace matching search terms, tags, segment, country_code, and creation date filters. phone returns the single contact owning that number as a primary or secondary number (E.164, or local with the workspace default country) and cannot be combined with other filters. updated_after (ISO-8601, UTC when no offset is given, inclusive) returns contacts changed since then, including contacts changed by imports, audience uploads and bulk tagging; ordering stays newest-created first.\n\n**Required Scope**: `contacts:read`",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 100
                        },
                        "description": "Number of records to return per page."
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Opaque cursor string for pagination."
                    },
                    {
                        "name": "country_code",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "pattern": "^[A-Za-z]{2}$"
                        },
                        "description": "Filter by ISO 3166-1 alpha-2 contact country. Unsupported codes return 422."
                    },
                    {
                        "name": "phone",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 32
                        },
                        "description": "Exact phone number (E.164, or local with the workspace default country), matched against primary and secondary numbers. Returns at most one contact and cannot be combined with other filters; an invalid number returns 422."
                    },
                    {
                        "name": "updated_after",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Inclusive lower bound on the last change, ISO-8601; a value without an offset is read as UTC. Also reflects tag changes and changes made by imports and bulk operations. An invalid value returns 422."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "phone": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "name": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "email": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "company": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "locale": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "country_code": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "description": "ISO 3166-1 alpha-2 contact country."
                                                    },
                                                    "tags": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "attributes": {
                                                        "type": "object"
                                                    },
                                                    "consent_status": {
                                                        "type": "string"
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    }
                                                },
                                                "required": [
                                                    "id"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "has_more": {
                                                    "type": "boolean"
                                                },
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "total": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": [
                                                {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "id": "5512",
                                                    "phone": "+96555000111",
                                                    "name": "Fatima Al-Sabah",
                                                    "email": "fatima@example.test",
                                                    "company": "Al-Sabah Trading",
                                                    "locale": "ar",
                                                    "country_code": "KW",
                                                    "tags": [
                                                        "vip"
                                                    ],
                                                    "attributes": {
                                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                                        "city": "Kuwait City"
                                                    },
                                                    "consent_status": "opted_in",
                                                    "created_at": "2026-10-17T08:02:11+03:00",
                                                    "updated_at": "2026-10-18T09:15:02+03:00"
                                                }
                                            ],
                                            "meta": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "has_more": true,
                                                "next_cursor": "eyJzIjoiMjAyNi0xMC0xOCIsImkiOjc2fQ",
                                                "total": 128
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "operationId": "api.v1.contacts.store",
                "summary": "Create a new contact.",
                "description": "Create a contact with phone, optional country_code (ISO 3166-1 alpha-2), name, email, company, locale, tags, and custom attributes. Country is used as the local phone parsing hint.\n\n**Required Scope**: `contacts:write`",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "email": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "company": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "country_code": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "ISO 3166-1 alpha-2 contact country."
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "attributes": {
                                                    "type": "object"
                                                },
                                                "consent_status": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "id": "5512",
                                                "phone": "+96555000111",
                                                "name": "Fatima Al-Sabah",
                                                "email": "fatima@example.test",
                                                "company": "Al-Sabah Trading",
                                                "locale": "ar",
                                                "country_code": "KW",
                                                "tags": [
                                                    "vip"
                                                ],
                                                "attributes": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "city": "Kuwait City"
                                                },
                                                "consent_status": "opted_in",
                                                "created_at": "2026-10-17T08:02:11+03:00",
                                                "updated_at": "2026-10-18T09:15:02+03:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: contact_already_exists, idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error: payload_too_large",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:write",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "phone": {
                                        "type": "string"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "company": {
                                        "type": "string"
                                    },
                                    "locale": {
                                        "type": "string",
                                        "enum": [
                                            "ar",
                                            "en"
                                        ]
                                    },
                                    "country_code": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "ISO 3166-1 alpha-2 country; used to parse local phone numbers."
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "attributes": {
                                        "type": "object"
                                    }
                                },
                                "required": [
                                    "phone"
                                ]
                            },
                            "examples": {
                                "default": {
                                    "value": {
                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                        "phone": "+96555000111",
                                        "name": "Fatima Al-Sabah",
                                        "email": "fatima@example.test",
                                        "company": "Al-Sabah Trading",
                                        "locale": "ar",
                                        "country_code": "KW",
                                        "tags": [
                                            "vip"
                                        ],
                                        "attributes": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "city": "Kuwait City"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{id}": {
            "get": {
                "operationId": "api.v1.contacts.show",
                "summary": "Retrieve a contact by ID.",
                "description": "Fetch details, tags, attributes, and consent status for a specific contact.\n\n**Required Scope**: `contacts:read`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "email": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "company": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "country_code": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "ISO 3166-1 alpha-2 contact country."
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "attributes": {
                                                    "type": "object"
                                                },
                                                "consent_status": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "patch": {
                "operationId": "api.v1.contacts.update",
                "summary": "Update an existing contact.",
                "description": "Apply field-level changes to a contact including country_code (or null to clear it), name, email, company, locale, tags, and custom attributes.\n\n**Required Scope**: `contacts:write`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "email": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "company": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "country_code": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "ISO 3166-1 alpha-2 contact country."
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "attributes": {
                                                    "type": "object"
                                                },
                                                "consent_status": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "id": "5512",
                                                "phone": "+96555000111",
                                                "name": "Fatima Al-Sabah",
                                                "email": "fatima@example.test",
                                                "company": "Al-Sabah Trading",
                                                "locale": "ar",
                                                "country_code": "KW",
                                                "tags": [
                                                    "vip"
                                                ],
                                                "attributes": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "city": "Kuwait City"
                                                },
                                                "consent_status": "opted_in",
                                                "created_at": "2026-10-17T08:02:11+03:00",
                                                "updated_at": "2026-10-18T09:15:02+03:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error: payload_too_large",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:write",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "company": {
                                        "type": "string"
                                    },
                                    "locale": {
                                        "type": "string",
                                        "enum": [
                                            "ar",
                                            "en"
                                        ]
                                    },
                                    "country_code": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "ISO 3166-1 alpha-2 country; null clears the value."
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "attributes": {
                                        "type": "object"
                                    }
                                }
                            },
                            "examples": {
                                "default": {
                                    "value": {
                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                        "name": "Fatima Al-Sabah",
                                        "company": "Al-Sabah Trading",
                                        "attributes": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "city": "Hawalli"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "api.v1.contacts.destroy",
                "summary": "Delete (archive) a contact.",
                "description": "Archive a contact in this workspace while preserving conversation history and consent state.\n\n**Required Scope**: `contacts:delete`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Resource deleted successfully.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:delete",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/contact-attributes": {
            "get": {
                "operationId": "api.v1.contact-attributes.index",
                "summary": "List custom contact attributes.",
                "description": "Returns the key, label, type and, for single-choice attributes, the options of every custom attribute defined in this workspace.\n\n**Required Scope**: `contacts:read`",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "key": {
                                                        "type": "string"
                                                    },
                                                    "label": {
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "type": "string",
                                                        "enum": [
                                                            "text",
                                                            "number",
                                                            "date",
                                                            "boolean",
                                                            "single_choice"
                                                        ]
                                                    },
                                                    "options": {
                                                        "type": [
                                                            "array",
                                                            "null"
                                                        ],
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "required": [
                                                    "key",
                                                    "label",
                                                    "type",
                                                    "options"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": [
                                                {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "key": "city",
                                                    "label": "City",
                                                    "type": "single_choice",
                                                    "options": [
                                                        "Kuwait City",
                                                        "Hawalli"
                                                    ]
                                                },
                                                {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "key": "vip_since",
                                                    "label": "VIP since",
                                                    "type": "date",
                                                    "options": null
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/contacts/{id}/tags": {
            "post": {
                "operationId": "api.v1.contacts.tags.store",
                "summary": "Add a tag to a contact.",
                "description": "Adds one tag, creating it if it does not exist, without touching the contact's other tags. Adding a tag the contact already has changes nothing.\n\n**Required Scope**: `contacts:write`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "email": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "company": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "country_code": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "ISO 3166-1 alpha-2 contact country."
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "attributes": {
                                                    "type": "object"
                                                },
                                                "consent_status": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "id": "5512",
                                                "phone": "+96555000111",
                                                "name": "Fatima Al-Sabah",
                                                "email": "fatima@example.test",
                                                "company": "Al-Sabah Trading",
                                                "locale": "ar",
                                                "country_code": "KW",
                                                "tags": [
                                                    "vip"
                                                ],
                                                "attributes": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "city": "Kuwait City"
                                                },
                                                "consent_status": "opted_in",
                                                "created_at": "2026-10-17T08:02:11+03:00",
                                                "updated_at": "2026-10-18T09:15:02+03:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error: payload_too_large",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:write",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tag": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "tag"
                                ]
                            },
                            "examples": {
                                "default": {
                                    "value": {
                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                        "tag": "vip"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{id}/tags/{tag}": {
            "delete": {
                "operationId": "api.v1.contacts.tags.destroy",
                "summary": "Remove a tag from a contact.",
                "description": "Removes one tag by name without touching the contact's other tags. Removing a tag the contact does not have changes nothing.\n\n**Required Scope**: `contacts:write`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "tag",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the tag."
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "email": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "company": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "country_code": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "ISO 3166-1 alpha-2 contact country."
                                                },
                                                "tags": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "attributes": {
                                                    "type": "object"
                                                },
                                                "consent_status": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "id": "5512",
                                                "phone": "+96555000111",
                                                "name": "Fatima Al-Sabah",
                                                "email": "fatima@example.test",
                                                "company": "Al-Sabah Trading",
                                                "locale": "ar",
                                                "country_code": "KW",
                                                "tags": [],
                                                "attributes": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "city": "Kuwait City"
                                                },
                                                "consent_status": "opted_in",
                                                "created_at": "2026-10-17T08:02:11+03:00",
                                                "updated_at": "2026-10-18T09:15:02+03:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:write",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/contact-imports": {
            "post": {
                "operationId": "api.v1.contact-imports.store",
                "summary": "Start a bulk contact import.",
                "description": "Upload a CSV file and column mapping to import contacts asynchronously.\n\n**Required Scope**: `contacts:import`",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "total_rows": {
                                                    "type": "integer"
                                                },
                                                "processed_rows": {
                                                    "type": "integer"
                                                },
                                                "created_count": {
                                                    "type": "integer"
                                                },
                                                "updated_count": {
                                                    "type": "integer"
                                                },
                                                "rejected_count": {
                                                    "type": "integer"
                                                },
                                                "started_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "status"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error: payload_too_large",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:import",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "mapping": {
                                        "type": "object"
                                    },
                                    "duplicate_strategy": {
                                        "type": "string",
                                        "enum": [
                                            "skip",
                                            "update"
                                        ]
                                    }
                                },
                                "required": [
                                    "file",
                                    "mapping",
                                    "duplicate_strategy"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/contact-imports/{id}": {
            "get": {
                "operationId": "api.v1.contact-imports.show",
                "summary": "Get contact import status and progress.",
                "description": "Fetch current progress, row counts, and completion status of a bulk contact import.\n\n**Required Scope**: `contacts:import`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "total_rows": {
                                                    "type": "integer"
                                                },
                                                "processed_rows": {
                                                    "type": "integer"
                                                },
                                                "created_count": {
                                                    "type": "integer"
                                                },
                                                "updated_count": {
                                                    "type": "integer"
                                                },
                                                "rejected_count": {
                                                    "type": "integer"
                                                },
                                                "started_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "status"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:import",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/contact-imports/{id}/rejections": {
            "get": {
                "operationId": "api.v1.contact-imports.rejections",
                "summary": "List rejected rows for a contact import.",
                "description": "Retrieve a cursor-paginated list of rejected and skipped rows for an import with rejection reasons and machine-readable error codes.\n\n**Required Scope**: `contacts:import`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 100
                        },
                        "description": "Number of records to return per page."
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Opaque cursor string for pagination."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "row_number": {
                                                        "type": "integer"
                                                    },
                                                    "reason": {
                                                        "type": "string"
                                                    },
                                                    "reason_code": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "row_number",
                                                    "reason"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "has_more": {
                                                    "type": "boolean"
                                                },
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "contacts:import",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/conversations": {
            "get": {
                "operationId": "api.v1.conversations.index",
                "summary": "List conversations with filters and cursor pagination.",
                "description": "Retrieve a cursor-paginated list of conversations in this workspace ordered by newest activity with optional state, assignee, contact, and date filters. Filter by channel type with channel and by public account ULID with channel_account_id.\n\n**Required Scope**: `conversations:read`",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 100
                        },
                        "description": "Number of records to return per page."
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Opaque cursor string for pagination."
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "closed",
                                "archived"
                            ]
                        },
                        "description": "Filter by conversation state."
                    },
                    {
                        "name": "assignee_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Filter by the member the conversation is assigned to (an id from GET /members)."
                    },
                    {
                        "name": "contact_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Return the conversations of one contact. Use it to find the conversation to assign or close."
                    },
                    {
                        "name": "updated_after",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Inclusive lower bound on the last change, ISO-8601."
                    },
                    {
                        "name": "updated_before",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Inclusive upper bound on the last change, ISO-8601."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "contact_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "channel": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "account_id": {
                                                                "type": "string"
                                                            },
                                                            "account_label": {
                                                                "type": "string"
                                                            },
                                                            "account_removed": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "account_id",
                                                            "account_label",
                                                            "account_removed"
                                                        ]
                                                    },
                                                    "participant": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "display_name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "external_id": {
                                                                "type": "string"
                                                            },
                                                            "external_id_label": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "display_name",
                                                            "external_id",
                                                            "external_id_label"
                                                        ]
                                                    },
                                                    "needs_contact_link": {
                                                        "type": "boolean"
                                                    },
                                                    "state": {
                                                        "type": "string"
                                                    },
                                                    "assignee_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "department_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "last_message_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "last_inbound_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "snoozed_until": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "closed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "internal_notes": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "string"
                                                                },
                                                                "body": {
                                                                    "type": "string"
                                                                },
                                                                "author_id": {
                                                                    "type": "string"
                                                                },
                                                                "created_at": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ],
                                                                    "format": "date-time"
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "body",
                                                                "author_id"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "state"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "has_more": {
                                                    "type": "boolean"
                                                },
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": [
                                                {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "id": "77",
                                                    "contact_id": "5512",
                                                    "channel": {
                                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                                        "type": "whatsapp",
                                                        "account_id": "01JBX6C4D8F1G5H9J2K6M0NPQR",
                                                        "account_label": "+965 5000 0111",
                                                        "account_removed": false
                                                    },
                                                    "participant": {
                                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                                        "id": "01JBX6C4D8F1G5H9J2K6M0NPQS",
                                                        "display_name": "Fatima Al-Sabah",
                                                        "external_id": "96555000203",
                                                        "external_id_label": "WhatsApp number"
                                                    },
                                                    "needs_contact_link": false,
                                                    "state": "open",
                                                    "assignee_id": "42",
                                                    "department_id": null,
                                                    "last_message_at": "2026-10-18T09:14:58+03:00",
                                                    "last_inbound_at": "2026-10-18T09:14:58+03:00",
                                                    "snoozed_until": null,
                                                    "closed_at": null,
                                                    "created_at": "2026-10-18T09:14:58+03:00",
                                                    "updated_at": "2026-10-18T09:20:00+03:00"
                                                }
                                            ],
                                            "meta": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "has_more": true,
                                                "next_cursor": "eyJzIjoiMjAyNi0xMC0xOCIsImkiOjc2fQ"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "conversations:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/conversations/{id}": {
            "get": {
                "operationId": "api.v1.conversations.show",
                "summary": "Retrieve a conversation by ID.",
                "description": "Fetch details and state of a conversation, including internal notes when the credential carries the notes:read scope. The response identifies the channel account and participant and reports whether the conversation needs a contact link.\n\n**Required Scope**: `conversations:read`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "contact_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "channel": {
                                                    "type": "object",
                                                    "properties": {
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "account_id": {
                                                            "type": "string"
                                                        },
                                                        "account_label": {
                                                            "type": "string"
                                                        },
                                                        "account_removed": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "type",
                                                        "account_id",
                                                        "account_label",
                                                        "account_removed"
                                                    ]
                                                },
                                                "participant": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "display_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "external_id": {
                                                            "type": "string"
                                                        },
                                                        "external_id_label": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "display_name",
                                                        "external_id",
                                                        "external_id_label"
                                                    ]
                                                },
                                                "needs_contact_link": {
                                                    "type": "boolean"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "assignee_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "department_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_message_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "last_inbound_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "snoozed_until": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "closed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "internal_notes": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "body": {
                                                                "type": "string"
                                                            },
                                                            "author_id": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "format": "date-time"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "body",
                                                            "author_id"
                                                        ]
                                                    }
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "state"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "conversations:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/conversations/{id}/messages": {
            "get": {
                "operationId": "api.v1.conversations.messages",
                "summary": "List messages in a conversation thread.",
                "description": "Retrieve a cursor-paginated chronological list of messages in a conversation thread with delivery states and media references. Each message includes canonical content, its channel account and its provider message reference.\n\n**Required Scope**: `conversations:read`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 100
                        },
                        "description": "Number of records to return per page."
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Opaque cursor string for pagination."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "direction": {
                                                        "type": "string"
                                                    },
                                                    "channel": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "account_id": {
                                                                "type": "string"
                                                            },
                                                            "account_label": {
                                                                "type": "string"
                                                            },
                                                            "account_removed": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "account_id",
                                                            "account_label",
                                                            "account_removed"
                                                        ]
                                                    },
                                                    "provider_message_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "quoted_message_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "content": {
                                                        "type": "object"
                                                    },
                                                    "source": {
                                                        "type": "string"
                                                    },
                                                    "ingestion_mode": {
                                                        "type": "string",
                                                        "enum": [
                                                            "live",
                                                            "history",
                                                            "echo"
                                                        ]
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "enum": [
                                                            "received",
                                                            "queued",
                                                            "sending",
                                                            "sent",
                                                            "delivered",
                                                            "read",
                                                            "failed",
                                                            "delivery_unconfirmed"
                                                        ]
                                                    },
                                                    "status_reason": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "provider_error_class": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "body_text": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "sent_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "delivered_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "read_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "failed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "media": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "media_kind": {
                                                                "type": "string"
                                                            },
                                                            "mime_type": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "caption": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "media_kind"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "direction",
                                                    "status"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "has_more": {
                                                    "type": "boolean"
                                                },
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "conversations:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/conversations/{id}/assign": {
            "post": {
                "operationId": "api.v1.conversations.assign",
                "summary": "Assign a conversation to a member.",
                "description": "Assigns the conversation to an active member of this workspace, using a member_id from GET /members. Assigning it to the member who already owns it changes nothing. A closed conversation cannot be assigned. The change is recorded against the API key.\n\n**Required Scope**: `conversations:assign`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "contact_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "channel": {
                                                    "type": "object",
                                                    "properties": {
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "account_id": {
                                                            "type": "string"
                                                        },
                                                        "account_label": {
                                                            "type": "string"
                                                        },
                                                        "account_removed": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "type",
                                                        "account_id",
                                                        "account_label",
                                                        "account_removed"
                                                    ]
                                                },
                                                "participant": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "display_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "external_id": {
                                                            "type": "string"
                                                        },
                                                        "external_id_label": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "display_name",
                                                        "external_id",
                                                        "external_id_label"
                                                    ]
                                                },
                                                "needs_contact_link": {
                                                    "type": "boolean"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "assignee_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "department_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_message_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "last_inbound_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "snoozed_until": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "closed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "internal_notes": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "body": {
                                                                "type": "string"
                                                            },
                                                            "author_id": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "format": "date-time"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "body",
                                                            "author_id"
                                                        ]
                                                    }
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "state"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "id": "77",
                                                "contact_id": "5512",
                                                "channel": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "type": "whatsapp",
                                                    "account_id": "01JBX6C4D8F1G5H9J2K6M0NPQR",
                                                    "account_label": "+965 5000 0111",
                                                    "account_removed": false
                                                },
                                                "participant": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "id": "01JBX6C4D8F1G5H9J2K6M0NPQS",
                                                    "display_name": "Fatima Al-Sabah",
                                                    "external_id": "96555000203",
                                                    "external_id_label": "WhatsApp number"
                                                },
                                                "needs_contact_link": false,
                                                "state": "open",
                                                "assignee_id": "42",
                                                "department_id": null,
                                                "last_message_at": "2026-10-18T09:14:58+03:00",
                                                "last_inbound_at": "2026-10-18T09:14:58+03:00",
                                                "snoozed_until": null,
                                                "closed_at": null,
                                                "created_at": "2026-10-18T09:14:58+03:00",
                                                "updated_at": "2026-10-18T09:20:00+03:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error: payload_too_large",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "conversations:assign",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "member_id": {
                                        "type": "string",
                                        "description": "A member id from GET /members."
                                    }
                                },
                                "required": [
                                    "member_id"
                                ]
                            },
                            "examples": {
                                "default": {
                                    "value": {
                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                        "member_id": "42"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/conversations/{id}/close": {
            "post": {
                "operationId": "api.v1.conversations.close",
                "summary": "Close a conversation.",
                "description": "Closes the conversation. Closing one that is already closed changes nothing. The change is recorded against the API key.\n\n**Required Scope**: `conversations:close`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "contact_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "channel": {
                                                    "type": "object",
                                                    "properties": {
                                                        "type": {
                                                            "type": "string"
                                                        },
                                                        "account_id": {
                                                            "type": "string"
                                                        },
                                                        "account_label": {
                                                            "type": "string"
                                                        },
                                                        "account_removed": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "type",
                                                        "account_id",
                                                        "account_label",
                                                        "account_removed"
                                                    ]
                                                },
                                                "participant": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "display_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "external_id": {
                                                            "type": "string"
                                                        },
                                                        "external_id_label": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "display_name",
                                                        "external_id",
                                                        "external_id_label"
                                                    ]
                                                },
                                                "needs_contact_link": {
                                                    "type": "boolean"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "assignee_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "department_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_message_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "last_inbound_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "snoozed_until": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "closed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "internal_notes": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "body": {
                                                                "type": "string"
                                                            },
                                                            "author_id": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "format": "date-time"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "body",
                                                            "author_id"
                                                        ]
                                                    }
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "state"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "id": "77",
                                                "contact_id": "5512",
                                                "channel": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "type": "whatsapp",
                                                    "account_id": "01JBX6C4D8F1G5H9J2K6M0NPQR",
                                                    "account_label": "+965 5000 0111",
                                                    "account_removed": false
                                                },
                                                "participant": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "id": "01JBX6C4D8F1G5H9J2K6M0NPQS",
                                                    "display_name": "Fatima Al-Sabah",
                                                    "external_id": "96555000203",
                                                    "external_id_label": "WhatsApp number"
                                                },
                                                "needs_contact_link": false,
                                                "state": "closed",
                                                "assignee_id": "42",
                                                "department_id": null,
                                                "last_message_at": "2026-10-18T09:14:58+03:00",
                                                "last_inbound_at": "2026-10-18T09:14:58+03:00",
                                                "snoozed_until": null,
                                                "closed_at": "2026-10-18T09:45:30+03:00",
                                                "created_at": "2026-10-18T09:14:58+03:00",
                                                "updated_at": "2026-10-18T09:20:00+03:00"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error: payload_too_large",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "conversations:close",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/members": {
            "get": {
                "operationId": "api.v1.members.index",
                "summary": "List the members conversations can be assigned to.",
                "description": "Returns the id and name of each active member of this workspace that a conversation can be assigned to. No email, phone number or role is exposed.\n\n**Required Scope**: `conversations:assign`",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 100
                        },
                        "description": "Number of records to return per page."
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Opaque cursor string for pagination."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "name"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "has_more": {
                                                    "type": "boolean"
                                                },
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": [
                                                {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "id": "42",
                                                    "name": "Fatima Al-Sabah"
                                                }
                                            ],
                                            "meta": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "has_more": false,
                                                "next_cursor": null
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "conversations:assign",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/templates": {
            "get": {
                "operationId": "api.v1.templates.index",
                "summary": "List message templates.",
                "description": "Retrieve a cursor-paginated list of WhatsApp templates with per-language approval status, categories, and variable definitions. name matches the template name exactly; language (ar, en or a locale such as en_US) and status (approved, pending, rejected, paused, disabled, failed) keep only templates having a language version that matches both.\n\n**Required Scope**: `templates:read`",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 100
                        },
                        "description": "Number of records to return per page."
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Opaque cursor string for pagination."
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Exact template name."
                    },
                    {
                        "name": "language",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Language bucket (ar, en) or locale code (for example en_US) of a version."
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "approved",
                                "pending",
                                "rejected",
                                "disabled",
                                "paused",
                                "failed"
                            ]
                        },
                        "description": "Approval status of a version. With language, both must hold for the same version."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "category": {
                                                        "type": "string"
                                                    },
                                                    "languages": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "language": {
                                                                    "type": "string"
                                                                },
                                                                "status": {
                                                                    "type": "string"
                                                                },
                                                                "variables": {
                                                                    "type": "array",
                                                                    "items": {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "position": {
                                                                                "type": "integer"
                                                                            },
                                                                            "example": {
                                                                                "type": "string"
                                                                            }
                                                                        },
                                                                        "required": [
                                                                            "position",
                                                                            "example"
                                                                        ]
                                                                    }
                                                                }
                                                            },
                                                            "required": [
                                                                "language",
                                                                "status",
                                                                "variables"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "required": [
                                                    "name",
                                                    "category",
                                                    "languages"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "has_more": {
                                                    "type": "boolean"
                                                },
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "total": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "has_more",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": [
                                                {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "name": "order_update",
                                                    "title": "Order update",
                                                    "category": "utility",
                                                    "languages": [
                                                        {
                                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                                            "language": "ar",
                                                            "wire_language": "ar",
                                                            "version_id": 31,
                                                            "available": true,
                                                            "status": "approved",
                                                            "quality": "green",
                                                            "variables": [
                                                                {
                                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                                    "position": 1,
                                                                    "example": "Fatima"
                                                                },
                                                                {
                                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                                    "position": 2,
                                                                    "example": "KWD 12.500"
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ],
                                            "meta": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "has_more": true,
                                                "next_cursor": "eyJzIjoiMjAyNi0xMC0xOCIsImkiOjc2fQ",
                                                "total": 14
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "templates:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/campaigns/{id}/trigger": {
            "post": {
                "operationId": "api.v1.campaigns.trigger",
                "summary": "Trigger execution of a prepared campaign.",
                "description": "Launch a prepared audience campaign asynchronously and receive an execution tracking identifier. The id is the number after /campaigns/ in the campaign page address; audience must be the exact name of the campaign audience and confirms the right campaign is launched.\n\n**Required Scope**: `campaigns:trigger`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "counts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "queued": {
                                                            "type": "integer"
                                                        },
                                                        "sent": {
                                                            "type": "integer"
                                                        },
                                                        "delivered": {
                                                            "type": "integer"
                                                        },
                                                        "read": {
                                                            "type": "integer"
                                                        },
                                                        "failed": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "required": [
                                                        "queued",
                                                        "sent",
                                                        "delivered",
                                                        "read",
                                                        "failed"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "state",
                                                "counts"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "id": "18",
                                                "state": "launching",
                                                "counts": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "queued": 0,
                                                    "sent": 0,
                                                    "delivered": 0,
                                                    "read": 0,
                                                    "failed": 0
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: campaign_not_launchable, idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Error: subscription_gated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error: payload_too_large",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "campaigns:trigger",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "audience": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "audience"
                                ]
                            },
                            "examples": {
                                "default": {
                                    "value": {
                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                        "audience": "Kuwait VIP customers"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/campaigns/{id}": {
            "get": {
                "operationId": "api.v1.campaigns.show",
                "summary": "Retrieve campaign state and delivery metrics.",
                "description": "Fetch the current state and real-time delivery counts (queued, sent, delivered, read, failed) for a campaign.\n\n**Required Scope**: `campaigns:trigger`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "state": {
                                                    "type": "string"
                                                },
                                                "counts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "queued": {
                                                            "type": "integer"
                                                        },
                                                        "sent": {
                                                            "type": "integer"
                                                        },
                                                        "delivered": {
                                                            "type": "integer"
                                                        },
                                                        "read": {
                                                            "type": "integer"
                                                        },
                                                        "failed": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "required": [
                                                        "queued",
                                                        "sent",
                                                        "delivered",
                                                        "read",
                                                        "failed"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "state",
                                                "counts"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "campaigns:trigger",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/webhook-endpoints": {
            "get": {
                "operationId": "api.v1.webhook-endpoints.index",
                "summary": "List configured webhook endpoints.",
                "description": "Retrieve all registered webhook destinations for this workspace. A key owned by an integration connection (Make, Zapier) lists only the live subscriptions of that connection; any other key lists only member-created endpoints.\n\n**Required Scope**: `webhooks:manage`",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    },
                                                    "event_types": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "is_paused": {
                                                        "type": "boolean"
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "name",
                                                    "url",
                                                    "event_types",
                                                    "status",
                                                    "is_paused"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "webhooks:manage",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "operationId": "api.v1.webhook-endpoints.store",
                "summary": "Create a new webhook endpoint.",
                "description": "Register an HTTP destination URL and subscribed event types. The signing secret is returned only once in this response. With a key owned by an integration connection this subscribes that connection: exactly one trigger event (message.inbound, conversation.new, conversation.assigned, conversation.closed, contact.created or contact.updated), an immutable URL, the matching read scope, and optional ignore_own_changes (default true, contact.updated only). Subscribing the same URL and event again answers 200 with the existing subscription and no new secret.\n\n**Required Scope**: `webhooks:manage`",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "event_types": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "is_paused": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "signing_secret": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "url",
                                                "event_types",
                                                "status",
                                                "is_paused",
                                                "signing_secret"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "id": "981",
                                                "name": "Make: CRM sync",
                                                "url": "https://hook.eu2.make.com/abc123def456",
                                                "event_types": [
                                                    "contact.updated"
                                                ],
                                                "status": "active",
                                                "is_paused": false,
                                                "created_at": "2026-10-18T09:00:00+03:00",
                                                "secret_last_four": "Xy9Q",
                                                "integration": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "connection_id": "01JBX5Q8M2N4R7T0V3W6Y9ZA1B",
                                                    "ignore_own_changes": true
                                                },
                                                "signing_secret": "example-signing-secret-shown-once"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error: payload_too_large",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "webhooks:manage",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "url": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "event_types": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "required": [
                                    "name",
                                    "url",
                                    "event_types"
                                ]
                            },
                            "examples": {
                                "default": {
                                    "value": {
                                        "__PHP_Incomplete_Class_Name": "stdClass",
                                        "url": "https://hook.eu2.make.com/abc123def456",
                                        "event_types": [
                                            "contact.updated"
                                        ],
                                        "name": "Make: CRM sync",
                                        "ignore_own_changes": true
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook-endpoints/{id}": {
            "patch": {
                "operationId": "api.v1.webhook-endpoints.update",
                "summary": "Update a webhook endpoint.",
                "description": "Modify the destination URL, name, subscribed event types, or active status of a webhook endpoint. A key owned by an integration connection can only pause or resume its own subscriptions (is_paused); URL and event cannot change.\n\n**Required Scope**: `webhooks:manage`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "event_types": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "is_paused": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "url",
                                                "event_types",
                                                "status",
                                                "is_paused"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error: payload_too_large",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "webhooks:manage",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "url": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "event_types": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "is_paused": {
                                        "type": "boolean"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "api.v1.webhook-endpoints.destroy",
                "summary": "Delete a webhook endpoint.",
                "description": "Permanently remove a webhook endpoint from this workspace. A key owned by an integration connection unsubscribes its own subscription; repeating the call answers 204 again, and another connection's subscription answers 404.\n\n**Required Scope**: `webhooks:manage`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Unique idempotency key preventing duplicate executions."
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Resource deleted successfully.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "Error: idempotency_key_reuse, idempotency_request_in_progress",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "webhooks:manage",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/me": {
            "get": {
                "operationId": "api.v1.me.show",
                "summary": "Show the calling key.",
                "description": "Returns the workspace, the API key and, for a key owned by an integration connection, that connection. Any authenticated key may call it; it needs no scope.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "workspace": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "locale": {
                                                            "type": "string"
                                                        },
                                                        "timezone": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name",
                                                        "locale",
                                                        "timezone"
                                                    ]
                                                },
                                                "api_key": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "last_four": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "scopes": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "format": "date-time"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name",
                                                        "scopes"
                                                    ]
                                                },
                                                "connection": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "provider": {
                                                            "type": "string"
                                                        },
                                                        "display_name": {
                                                            "type": "string"
                                                        },
                                                        "status": {
                                                            "type": "string",
                                                            "enum": [
                                                                "connected"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "api_version": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "workspace",
                                                "api_key",
                                                "connection",
                                                "api_version"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "examples": {
                                    "default": {
                                        "value": {
                                            "__PHP_Incomplete_Class_Name": "stdClass",
                                            "data": {
                                                "__PHP_Incomplete_Class_Name": "stdClass",
                                                "workspace": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "id": "acme",
                                                    "name": "Acme Kuwait",
                                                    "locale": "ar",
                                                    "timezone": "Asia/Kuwait"
                                                },
                                                "api_key": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "id": "01JBX6C4D8F1G5H9J2K6M0NPQR",
                                                    "name": "Zapier \u00b7 Sales team",
                                                    "last_four": "9fQe",
                                                    "scopes": [
                                                        "contacts:read",
                                                        "webhooks:manage"
                                                    ],
                                                    "expires_at": null
                                                },
                                                "connection": {
                                                    "__PHP_Incomplete_Class_Name": "stdClass",
                                                    "id": "01JBX5Q8M2N4R7T0V3W6Y9ZA1B",
                                                    "provider": "zapier",
                                                    "display_name": "Zapier",
                                                    "status": "connected"
                                                },
                                                "api_version": "2026-11-11"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Error: temporarily_unavailable",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": []
            }
        },
        "/commerce/stores": {
            "get": {
                "operationId": "api.v1.commerce.stores.index",
                "summary": "List connected stores.",
                "description": "Returns every store connected to this workspace, including a disconnected store whose data is kept until its removal date. Each store reports its import state, when it last synchronized and whether its data is stale.\n\n**Required Scope**: `commerce:read`",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "provider": {
                                                        "type": "string"
                                                    },
                                                    "url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "default_currency": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "timezone": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "country": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "state": {
                                                        "type": "string",
                                                        "description": "The connection lifecycle state."
                                                    },
                                                    "import_state": {
                                                        "type": "string",
                                                        "enum": [
                                                            "pending",
                                                            "importing",
                                                            "complete",
                                                            "failed"
                                                        ]
                                                    },
                                                    "data_since": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "last_synced_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "stale": {
                                                        "type": "boolean"
                                                    },
                                                    "disconnected_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "data_removal_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "provider",
                                                    "state",
                                                    "import_state",
                                                    "stale"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "commerce:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/commerce/orders": {
            "get": {
                "operationId": "api.v1.commerce.orders.index",
                "summary": "List store orders with filters and cursor pagination.",
                "description": "Returns the orders imported from the connected stores, newest change first. Filter by store, order, payment or fulfillment status, last change (updated_since, ISO-8601, inclusive) or the buyer phone number in any format. A phone number that cannot be read returns an empty page. List items omit line items and fulfillments; fetch one order for those. Amounts are exact: integer minor units with their currency and exponent. Provider identifiers are never returned. Pages are ordered by change time, so an order that changes while you page can be missed: poll for changes with updated_since instead of re-walking the pages.\n\n**Required Scope**: `commerce:read`",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 25,
                            "maximum": 100
                        },
                        "description": "Number of records to return per page."
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Opaque cursor string for pagination."
                    },
                    {
                        "name": "store",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Only the orders of this store (an id from GET /commerce/stores)."
                    },
                    {
                        "name": "order_status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Normalized order status."
                    },
                    {
                        "name": "payment_status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Normalized payment status."
                    },
                    {
                        "name": "fulfillment_status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Normalized fulfillment status."
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Inclusive lower bound on the last change, ISO-8601; a value without an offset is read as UTC."
                    },
                    {
                        "name": "phone",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 32
                        },
                        "description": "Buyer phone number in any format. A number that cannot be read returns an empty page, not an error."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "store": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "description": "Id of the store the order belongs to."
                                                    },
                                                    "number": {
                                                        "type": "string"
                                                    },
                                                    "currency": {
                                                        "type": "string"
                                                    },
                                                    "totals": {
                                                        "type": "object",
                                                        "properties": {
                                                            "subtotal": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "amount_minor": {
                                                                        "type": "integer",
                                                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "ISO 4217 code."
                                                                    },
                                                                    "exponent": {
                                                                        "type": "integer",
                                                                        "description": "Number of minor-unit digits of the currency."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "amount_minor",
                                                                    "currency",
                                                                    "exponent"
                                                                ]
                                                            },
                                                            "discount": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "amount_minor": {
                                                                        "type": "integer",
                                                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "ISO 4217 code."
                                                                    },
                                                                    "exponent": {
                                                                        "type": "integer",
                                                                        "description": "Number of minor-unit digits of the currency."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "amount_minor",
                                                                    "currency",
                                                                    "exponent"
                                                                ]
                                                            },
                                                            "shipping": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "amount_minor": {
                                                                        "type": "integer",
                                                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "ISO 4217 code."
                                                                    },
                                                                    "exponent": {
                                                                        "type": "integer",
                                                                        "description": "Number of minor-unit digits of the currency."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "amount_minor",
                                                                    "currency",
                                                                    "exponent"
                                                                ]
                                                            },
                                                            "tax": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "amount_minor": {
                                                                        "type": "integer",
                                                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "ISO 4217 code."
                                                                    },
                                                                    "exponent": {
                                                                        "type": "integer",
                                                                        "description": "Number of minor-unit digits of the currency."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "amount_minor",
                                                                    "currency",
                                                                    "exponent"
                                                                ]
                                                            },
                                                            "total": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "amount_minor": {
                                                                        "type": "integer",
                                                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "ISO 4217 code."
                                                                    },
                                                                    "exponent": {
                                                                        "type": "integer",
                                                                        "description": "Number of minor-unit digits of the currency."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "amount_minor",
                                                                    "currency",
                                                                    "exponent"
                                                                ]
                                                            },
                                                            "original_total": {
                                                                "oneOf": [
                                                                    {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "amount_minor": {
                                                                                "type": "integer",
                                                                                "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                            },
                                                                            "currency": {
                                                                                "type": "string",
                                                                                "description": "ISO 4217 code."
                                                                            },
                                                                            "exponent": {
                                                                                "type": "integer",
                                                                                "description": "Number of minor-unit digits of the currency."
                                                                            }
                                                                        },
                                                                        "required": [
                                                                            "amount_minor",
                                                                            "currency",
                                                                            "exponent"
                                                                        ]
                                                                    },
                                                                    {
                                                                        "type": "null"
                                                                    }
                                                                ]
                                                            },
                                                            "refunded_total": {
                                                                "oneOf": [
                                                                    {
                                                                        "type": "object",
                                                                        "properties": {
                                                                            "amount_minor": {
                                                                                "type": "integer",
                                                                                "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                            },
                                                                            "currency": {
                                                                                "type": "string",
                                                                                "description": "ISO 4217 code."
                                                                            },
                                                                            "exponent": {
                                                                                "type": "integer",
                                                                                "description": "Number of minor-unit digits of the currency."
                                                                            }
                                                                        },
                                                                        "required": [
                                                                            "amount_minor",
                                                                            "currency",
                                                                            "exponent"
                                                                        ]
                                                                    },
                                                                    {
                                                                        "type": "null"
                                                                    }
                                                                ]
                                                            }
                                                        }
                                                    },
                                                    "presentment_total": {
                                                        "oneOf": [
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "amount_minor": {
                                                                        "type": "integer",
                                                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "ISO 4217 code."
                                                                    },
                                                                    "exponent": {
                                                                        "type": "integer",
                                                                        "description": "Number of minor-unit digits of the currency."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "amount_minor",
                                                                    "currency",
                                                                    "exponent"
                                                                ]
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "presentment_original_total": {
                                                        "oneOf": [
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "amount_minor": {
                                                                        "type": "integer",
                                                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "ISO 4217 code."
                                                                    },
                                                                    "exponent": {
                                                                        "type": "integer",
                                                                        "description": "Number of minor-unit digits of the currency."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "amount_minor",
                                                                    "currency",
                                                                    "exponent"
                                                                ]
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "presentment_refunded_total": {
                                                        "oneOf": [
                                                            {
                                                                "type": "object",
                                                                "properties": {
                                                                    "amount_minor": {
                                                                        "type": "integer",
                                                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "ISO 4217 code."
                                                                    },
                                                                    "exponent": {
                                                                        "type": "integer",
                                                                        "description": "Number of minor-unit digits of the currency."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "amount_minor",
                                                                    "currency",
                                                                    "exponent"
                                                                ]
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ]
                                                    },
                                                    "status": {
                                                        "type": "object",
                                                        "description": "Normalized statuses with the store's own wording beside each.",
                                                        "properties": {
                                                            "order": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "open",
                                                                    "completed",
                                                                    "cancelled",
                                                                    "unknown"
                                                                ]
                                                            },
                                                            "order_raw": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "payment": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "pending",
                                                                    "authorized",
                                                                    "paid",
                                                                    "partially_paid",
                                                                    "partially_refunded",
                                                                    "refunded",
                                                                    "voided",
                                                                    "failed",
                                                                    "unknown"
                                                                ]
                                                            },
                                                            "payment_raw": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "fulfillment": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "unfulfilled",
                                                                    "partially_fulfilled",
                                                                    "fulfilled",
                                                                    "in_transit",
                                                                    "delivered",
                                                                    "returned",
                                                                    "not_provided",
                                                                    "unknown"
                                                                ]
                                                            },
                                                            "fulfillment_raw": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    },
                                                    "payment_method": {
                                                        "type": "object",
                                                        "properties": {
                                                            "category": {
                                                                "type": "string"
                                                            },
                                                            "raw": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    },
                                                    "customer": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "description": "An erased customer is only its id and erased=true.",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "phone": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "description": "E.164."
                                                            },
                                                            "erased": {
                                                                "type": "boolean"
                                                            },
                                                            "contact_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ],
                                                                "description": "Id of the linked contact, usable with GET /contacts/{id}."
                                                            },
                                                            "link_state": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "linked",
                                                                    "no_match",
                                                                    "no_phone",
                                                                    "invalid_phone",
                                                                    "ambiguous"
                                                                ]
                                                            }
                                                        }
                                                    },
                                                    "order_url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "test": {
                                                        "type": "boolean",
                                                        "description": "True for a test order placed in the store (never a real sale)."
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "cancelled_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "closed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "flags": {
                                                        "type": "object",
                                                        "properties": {
                                                            "incomplete": {
                                                                "type": "boolean"
                                                            },
                                                            "items_truncated": {
                                                                "type": "boolean"
                                                            },
                                                            "source_items_incomplete": {
                                                                "type": [
                                                                    "boolean",
                                                                    "null"
                                                                ]
                                                            },
                                                            "needs_reconciliation": {
                                                                "type": "boolean"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error: validation_failed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "commerce:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/commerce/orders/{id}": {
            "get": {
                "operationId": "api.v1.commerce.orders.show",
                "summary": "Retrieve a store order by ID.",
                "description": "Returns one order with its line items and fulfillments. An order that does not exist, was deleted in the store or belongs to another workspace answers 404.\n\n**Required Scope**: `commerce:read`",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Identifier of the id."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "store": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Id of the store the order belongs to."
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "totals": {
                                                    "type": "object",
                                                    "properties": {
                                                        "subtotal": {
                                                            "type": "object",
                                                            "properties": {
                                                                "amount_minor": {
                                                                    "type": "integer",
                                                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                },
                                                                "currency": {
                                                                    "type": "string",
                                                                    "description": "ISO 4217 code."
                                                                },
                                                                "exponent": {
                                                                    "type": "integer",
                                                                    "description": "Number of minor-unit digits of the currency."
                                                                }
                                                            },
                                                            "required": [
                                                                "amount_minor",
                                                                "currency",
                                                                "exponent"
                                                            ]
                                                        },
                                                        "discount": {
                                                            "type": "object",
                                                            "properties": {
                                                                "amount_minor": {
                                                                    "type": "integer",
                                                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                },
                                                                "currency": {
                                                                    "type": "string",
                                                                    "description": "ISO 4217 code."
                                                                },
                                                                "exponent": {
                                                                    "type": "integer",
                                                                    "description": "Number of minor-unit digits of the currency."
                                                                }
                                                            },
                                                            "required": [
                                                                "amount_minor",
                                                                "currency",
                                                                "exponent"
                                                            ]
                                                        },
                                                        "shipping": {
                                                            "type": "object",
                                                            "properties": {
                                                                "amount_minor": {
                                                                    "type": "integer",
                                                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                },
                                                                "currency": {
                                                                    "type": "string",
                                                                    "description": "ISO 4217 code."
                                                                },
                                                                "exponent": {
                                                                    "type": "integer",
                                                                    "description": "Number of minor-unit digits of the currency."
                                                                }
                                                            },
                                                            "required": [
                                                                "amount_minor",
                                                                "currency",
                                                                "exponent"
                                                            ]
                                                        },
                                                        "tax": {
                                                            "type": "object",
                                                            "properties": {
                                                                "amount_minor": {
                                                                    "type": "integer",
                                                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                },
                                                                "currency": {
                                                                    "type": "string",
                                                                    "description": "ISO 4217 code."
                                                                },
                                                                "exponent": {
                                                                    "type": "integer",
                                                                    "description": "Number of minor-unit digits of the currency."
                                                                }
                                                            },
                                                            "required": [
                                                                "amount_minor",
                                                                "currency",
                                                                "exponent"
                                                            ]
                                                        },
                                                        "total": {
                                                            "type": "object",
                                                            "properties": {
                                                                "amount_minor": {
                                                                    "type": "integer",
                                                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                },
                                                                "currency": {
                                                                    "type": "string",
                                                                    "description": "ISO 4217 code."
                                                                },
                                                                "exponent": {
                                                                    "type": "integer",
                                                                    "description": "Number of minor-unit digits of the currency."
                                                                }
                                                            },
                                                            "required": [
                                                                "amount_minor",
                                                                "currency",
                                                                "exponent"
                                                            ]
                                                        },
                                                        "original_total": {
                                                            "oneOf": [
                                                                {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "amount_minor": {
                                                                            "type": "integer",
                                                                            "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                        },
                                                                        "currency": {
                                                                            "type": "string",
                                                                            "description": "ISO 4217 code."
                                                                        },
                                                                        "exponent": {
                                                                            "type": "integer",
                                                                            "description": "Number of minor-unit digits of the currency."
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "amount_minor",
                                                                        "currency",
                                                                        "exponent"
                                                                    ]
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        },
                                                        "refunded_total": {
                                                            "oneOf": [
                                                                {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "amount_minor": {
                                                                            "type": "integer",
                                                                            "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                        },
                                                                        "currency": {
                                                                            "type": "string",
                                                                            "description": "ISO 4217 code."
                                                                        },
                                                                        "exponent": {
                                                                            "type": "integer",
                                                                            "description": "Number of minor-unit digits of the currency."
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "amount_minor",
                                                                        "currency",
                                                                        "exponent"
                                                                    ]
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ]
                                                        }
                                                    }
                                                },
                                                "presentment_total": {
                                                    "oneOf": [
                                                        {
                                                            "type": "object",
                                                            "properties": {
                                                                "amount_minor": {
                                                                    "type": "integer",
                                                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                },
                                                                "currency": {
                                                                    "type": "string",
                                                                    "description": "ISO 4217 code."
                                                                },
                                                                "exponent": {
                                                                    "type": "integer",
                                                                    "description": "Number of minor-unit digits of the currency."
                                                                }
                                                            },
                                                            "required": [
                                                                "amount_minor",
                                                                "currency",
                                                                "exponent"
                                                            ]
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "presentment_original_total": {
                                                    "oneOf": [
                                                        {
                                                            "type": "object",
                                                            "properties": {
                                                                "amount_minor": {
                                                                    "type": "integer",
                                                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                },
                                                                "currency": {
                                                                    "type": "string",
                                                                    "description": "ISO 4217 code."
                                                                },
                                                                "exponent": {
                                                                    "type": "integer",
                                                                    "description": "Number of minor-unit digits of the currency."
                                                                }
                                                            },
                                                            "required": [
                                                                "amount_minor",
                                                                "currency",
                                                                "exponent"
                                                            ]
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "presentment_refunded_total": {
                                                    "oneOf": [
                                                        {
                                                            "type": "object",
                                                            "properties": {
                                                                "amount_minor": {
                                                                    "type": "integer",
                                                                    "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                },
                                                                "currency": {
                                                                    "type": "string",
                                                                    "description": "ISO 4217 code."
                                                                },
                                                                "exponent": {
                                                                    "type": "integer",
                                                                    "description": "Number of minor-unit digits of the currency."
                                                                }
                                                            },
                                                            "required": [
                                                                "amount_minor",
                                                                "currency",
                                                                "exponent"
                                                            ]
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "status": {
                                                    "type": "object",
                                                    "description": "Normalized statuses with the store's own wording beside each.",
                                                    "properties": {
                                                        "order": {
                                                            "type": "string",
                                                            "enum": [
                                                                "open",
                                                                "completed",
                                                                "cancelled",
                                                                "unknown"
                                                            ]
                                                        },
                                                        "order_raw": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "payment": {
                                                            "type": "string",
                                                            "enum": [
                                                                "pending",
                                                                "authorized",
                                                                "paid",
                                                                "partially_paid",
                                                                "partially_refunded",
                                                                "refunded",
                                                                "voided",
                                                                "failed",
                                                                "unknown"
                                                            ]
                                                        },
                                                        "payment_raw": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "fulfillment": {
                                                            "type": "string",
                                                            "enum": [
                                                                "unfulfilled",
                                                                "partially_fulfilled",
                                                                "fulfilled",
                                                                "in_transit",
                                                                "delivered",
                                                                "returned",
                                                                "not_provided",
                                                                "unknown"
                                                            ]
                                                        },
                                                        "fulfillment_raw": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "payment_method": {
                                                    "type": "object",
                                                    "properties": {
                                                        "category": {
                                                            "type": "string"
                                                        },
                                                        "raw": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "customer": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "description": "An erased customer is only its id and erased=true.",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "phone": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "E.164."
                                                        },
                                                        "erased": {
                                                            "type": "boolean"
                                                        },
                                                        "contact_id": {
                                                            "type": [
                                                                "integer",
                                                                "null"
                                                            ],
                                                            "description": "Id of the linked contact, usable with GET /contacts/{id}."
                                                        },
                                                        "link_state": {
                                                            "type": "string",
                                                            "enum": [
                                                                "linked",
                                                                "no_match",
                                                                "no_phone",
                                                                "invalid_phone",
                                                                "ambiguous"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "order_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "test": {
                                                    "type": "boolean",
                                                    "description": "True for a test order placed in the store (never a real sale)."
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "cancelled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "closed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "flags": {
                                                    "type": "object",
                                                    "properties": {
                                                        "incomplete": {
                                                            "type": "boolean"
                                                        },
                                                        "items_truncated": {
                                                            "type": "boolean"
                                                        },
                                                        "source_items_incomplete": {
                                                            "type": [
                                                                "boolean",
                                                                "null"
                                                            ]
                                                        },
                                                        "needs_reconciliation": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "title": {
                                                                "type": "string"
                                                            },
                                                            "variant_title": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "sku": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "quantity": {
                                                                "type": "integer"
                                                            },
                                                            "current_quantity": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "unit_price": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "amount_minor": {
                                                                        "type": "integer",
                                                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "ISO 4217 code."
                                                                    },
                                                                    "exponent": {
                                                                        "type": "integer",
                                                                        "description": "Number of minor-unit digits of the currency."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "amount_minor",
                                                                    "currency",
                                                                    "exponent"
                                                                ]
                                                            },
                                                            "line_total": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "amount_minor": {
                                                                        "type": "integer",
                                                                        "description": "Exact amount in minor units (for KWD, 12345 is 12.345)."
                                                                    },
                                                                    "currency": {
                                                                        "type": "string",
                                                                        "description": "ISO 4217 code."
                                                                    },
                                                                    "exponent": {
                                                                        "type": "integer",
                                                                        "description": "Number of minor-unit digits of the currency."
                                                                    }
                                                                },
                                                                "required": [
                                                                    "amount_minor",
                                                                    "currency",
                                                                    "exponent"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                },
                                                "fulfillments": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "status_raw": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "carrier": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "tracking_numbers": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "tracking_urls": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error: not_found",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Error: scope_missing",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: unauthenticated",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error: rate_limited",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorEnvelope"
                                }
                            }
                        }
                    }
                },
                "x-required-scope": "commerce:read",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/openapi.json": {
            "get": {
                "operationId": "api.v1.openapi",
                "summary": "Download OpenAPI 3.1 machine-readable specification.",
                "description": "Fetch the full OpenAPI 3.1 JSON specification describing all Public API endpoints, schemas, and error codes.",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Reset": {
                                "$ref": "#/components/headers/X-RateLimit-Reset"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "description": "OpenAPI 3.1 specification document."
                                }
                            }
                        }
                    }
                },
                "security": []
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "tgcp_live_{token_id}_{secret}",
                "description": "Workspace API Key Bearer token in the format Bearer tgcp_live_{token_id}_{secret}."
            }
        },
        "headers": {
            "X-RateLimit-Limit": {
                "description": "Maximum allowed requests per minute for this credential.",
                "schema": {
                    "type": "integer"
                }
            },
            "X-RateLimit-Remaining": {
                "description": "Remaining requests permitted in the current rate-limit window.",
                "schema": {
                    "type": "integer"
                }
            },
            "X-RateLimit-Reset": {
                "description": "Unix timestamp when the current rate-limit window resets.",
                "schema": {
                    "type": "integer"
                }
            }
        },
        "schemas": {
            "ApiErrorCode": {
                "type": "string",
                "enum": [
                    "malformed_request",
                    "unauthenticated",
                    "tls_required",
                    "scope_missing",
                    "subscription_gated",
                    "not_found",
                    "idempotency_key_reuse",
                    "idempotency_request_in_progress",
                    "contact_already_exists",
                    "campaign_not_launchable",
                    "payload_too_large",
                    "validation_failed",
                    "template_not_available",
                    "service_window_closed",
                    "contact_opted_out",
                    "not_connected",
                    "channel_required",
                    "channel_account_required",
                    "channel_account_mismatch",
                    "channel_account_unavailable",
                    "channel_account_revoked",
                    "channel_account_removed",
                    "contact_archived",
                    "template_unusable",
                    "template_paused",
                    "unsupported_capability:template",
                    "unsupported_capability:text",
                    "rate_limited",
                    "temporarily_unavailable"
                ],
                "description": "Machine-readable error code."
            },
            "ResponseEnvelope": {
                "type": "object",
                "properties": {
                    "data": {
                        "description": "The primary resource payload."
                    }
                },
                "required": [
                    "data"
                ]
            },
            "PaginationMeta": {
                "type": "object",
                "properties": {
                    "has_more": {
                        "type": "boolean",
                        "description": "Indicates whether more records exist beyond the current page."
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Opaque cursor pointing to the next page of records, or null if on the last page."
                    },
                    "total": {
                        "type": "integer",
                        "description": "Total count of records matching the query in the workspace (contacts and templates only)."
                    }
                },
                "required": [
                    "has_more"
                ]
            },
            "ErrorEnvelope": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "$ref": "#/components/schemas/ApiErrorCode"
                            },
                            "message": {
                                "type": "string",
                                "description": "Localised human-readable error explanation."
                            },
                            "details": {
                                "type": "object",
                                "description": "Optional structured error details context."
                            }
                        },
                        "required": [
                            "code",
                            "message"
                        ]
                    }
                },
                "required": [
                    "error"
                ]
            }
        }
    }
}