{
  "openapi": "3.1.0",
  "info": {
    "title": "AchieveApex REST API",
    "version": "2026-11-21",
    "description": "Public REST API of AchieveApex. Authenticate with an organization API key in the `x-api-key` header. Reads are scoped to the key's organization. GET requests take filters in the query string (`field=value`, `field[$in][]=`, `field[$gt]=`, `$limit` max 50, `$skip`, `$sort[field]=-1`). DELETE is a soft delete. Custom actions are `POST /<resource>` with header `X-Service-Method: <action>` (see `x-custom-methods`). Human docs: https://www.achieveapex.com/docs/api-reference/authentication",
    "contact": {
      "name": "AchieveApex",
      "url": "https://www.achieveapex.com"
    }
  },
  "externalDocs": {
    "description": "API reference",
    "url": "https://www.achieveapex.com/docs/api-reference/authentication"
  },
  "servers": [
    {
      "url": "https://integrations.achieveapex.com"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Activities",
      "description": "An activity is a task, call, meeting or other to-do on your calendar, optionally linked to a deal, contact or company and assigned to a user. When the assigned user has a connected Google or Outlook calendar that syncs the activity's type, the activity is also created on that calendar.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/activities"
      }
    },
    {
      "name": "Activity types",
      "description": "Activity types are the custom categories (with a color and icon) your organization defines for [activities](/docs/api-reference/activities), on top of the built-in ones.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/activity-types"
      }
    },
    {
      "name": "AI Assistant Skills",
      "description": "A skill is a focused block of knowledge or procedure attached to an AI assistant. The assistant loads it only when `when_to_use` matches the situation, which keeps the main instructions short.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/ai-assistant-skills"
      }
    },
    {
      "name": "AI Assistants",
      "description": "An AI assistant answers conversations, support tickets, internal AI chat or voice calls on behalf of your organization. Everything you can configure on the assistant settings page (instructions, handoff, follow-ups, tools, schedule, voice) is stored on the assistant record, so you can manage it entirely through this resource.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/ai-assistants"
      }
    },
    {
      "name": "AI Models",
      "description": "The AI model catalog lists the language models an AI assistant can run on. It is global and read-only: use a model's `id` as `ai_model_id` when you create or update an [AI assistant](/docs/api-reference/ai-assistants).",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/ai-models"
      }
    },
    {
      "name": "API Tools",
      "description": "An API tool describes an external HTTP request that AI assistants can make: the endpoint, method, headers, and the parameters the AI fills in or that are always fixed. Create a tool once, then attach it to assistants through their `api_tools` field.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/api-tools"
      }
    },
    {
      "name": "Automation executions",
      "description": "An automation execution is one run of an automation built in the AchieveApex app. Create one to run an automation with your own input data (for example a conversation and its contact), then read it to follow its status and result. Automations themselves are built in the app; get the `automation_id` from the automation's page.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/automations-executions"
      }
    },
    {
      "name": "Campaign Segments",
      "description": "A campaign segment is a saved audience: the contacts that match a set of rules, for one sending channel. Campaigns and automations send to segments. A segment is built either with the visual builder (`builder_type: \"manual\"`, rules in `query`) or with AI (`builder_type: \"ai\"`, a SQL selector in `ai_sql_query`).",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/campaign-segments"
      }
    },
    {
      "name": "Companies",
      "description": "A company is an account or business your contacts and deals belong to. Use this resource to keep company records in sync, link contacts and deals to them, and store custom fields and tags.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/companies"
      }
    },
    {
      "name": "Contacts",
      "description": "A contact is a person your organization talks to: a lead, a customer or someone who wrote to one of your channels (WhatsApp, Instagram, Messenger, SMS, webchat). Use this resource to sync people from another system, look them up by phone or email, and keep their custom fields, tags and Do Not Disturb flags up to date.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/contacts"
      }
    },
    {
      "name": "Conversation files",
      "description": "A conversation file is the record of an attachment uploaded to a conversation (image, audio, video or document). Register the file after uploading it, then reference it when you [send a message](/docs/api-reference/conversation-messages/send).",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/conversation-files"
      }
    },
    {
      "name": "Conversations",
      "description": "A conversation is one chat thread between your organization and a contact on one channel (WhatsApp, Instagram, Messenger, webchat, SMS or the AI assistant playground). Use it to list and filter your inbox, assign owners and AI assistants, move threads through pipelines, and close or reopen them. Messages live in [Conversation messages](/docs/api-reference/conversation-messages).",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/conversations"
      }
    },
    {
      "name": "Conversation messages",
      "description": "Messages of a [conversation](/docs/api-reference/conversations). Each channel has its own message service: read the conversation's `channel` and use the matching path. Customer-facing messages on Meta channels and webchat are **sent** through an \"outgoing\" service that builds the channel payload and then stores the message; SMS and playground messages are sent directly on their message service.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages"
      }
    },
    {
      "name": "Predefined messages",
      "description": "Predefined messages are the organization's canned replies (text or media) that agents insert from the conversation composer.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/conversation-predefined-messages"
      }
    },
    {
      "name": "Custom fields",
      "description": "Custom fields are the extra properties your organization defines for contacts, companies, deals, tickets, reservations, sales documents and products. Each field has a `key`; you write values on a record with `custom_fields_by_key` using that key.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/custom-fields"
      }
    },
    {
      "name": "Deal products",
      "description": "A deal product is a line item on a [deal](/docs/api-reference/deals): a product (or free-text item) with quantity, unit price, discount and tax. The deal's `amount` is kept equal to the sum of `total_amount_with_tax` of its deal products.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/deal-products"
      }
    },
    {
      "name": "Deals",
      "description": "A deal is a sales opportunity that moves through the stages of a deal [pipeline](/docs/api-reference/pipelines). Each deal belongs to a contact, can be linked to a company, has an amount in a currency, and is `open`, `won` or `lost`.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/deals"
      }
    },
    {
      "name": "Export data",
      "description": "Exports records of your organization (contacts, companies, deals, activities, products, campaign results) to a spreadsheet file. The export runs while the request is open and the response contains a `fileUrl` to download the file. Nothing is stored as an \"export\" record: this resource only has a create action.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/export-data"
      }
    },
    {
      "name": "Loyalty actions",
      "description": "Cashier and card operations: scan codes, register purchases, check in memberships, top up gift cards and share cards.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/loyalty-actions"
      }
    },
    {
      "name": "Loyalty members",
      "description": "A **loyalty member** is one customer's card in one program. A contact can have one card per program. Each card has a `member_code` (the code printed in its QR and scanned at the counter), a `balance` (points, stamps, money or uses depending on the program type) and a private `card_url` the customer can open on their phone or add to Apple Wallet / Google Wallet.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/loyalty-members"
      }
    },
    {
      "name": "Loyalty programs",
      "description": "A **loyalty program** is a card your customers carry: a stamp card, a points program, cashback, a membership (a pack of uses) or a gift card. Each customer gets one **member** card per program. Programs are usually configured in the Loyalty app; through the API you read them to know their ID, type, currency and enrollment link, and you can also create and configure them.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/loyalty-programs"
      }
    },
    {
      "name": "Loyalty rewards",
      "description": "The reward catalog of a loyalty program.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/loyalty-rewards"
      }
    },
    {
      "name": "Loyalty tiers",
      "description": "Tiers (levels such as Silver, Gold, Platinum) of a loyalty program.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/loyalty-tiers"
      }
    },
    {
      "name": "MCP Tool Connections",
      "description": "AI assistants can call tools from external Model Context Protocol (MCP) servers. A connection is not a separate resource: it is an item of the assistant's `mcp_tools` array. Use the connection test to check a server and read its tools, then save the connection on the assistant.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/mcp-tool-connections"
      }
    },
    {
      "name": "Organizations",
      "description": "An organization is your AchieveApex workspace: it owns every contact, deal, conversation and setting. Use this resource to read the organization's settings, wallet balance, plan and usage limits, and to update its general settings.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/organizations"
      }
    },
    {
      "name": "Organization invitations",
      "description": "An invitation asks someone, by email, to join your organization with a role. Creating one emails the person a link; when they accept it they become a member of the organization. Invitations expire 24 hours after they are created.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/organizations-users-invites"
      }
    },
    {
      "name": "Pipeline stages",
      "description": "A stage is one column of a [pipeline](/docs/api-reference/pipelines), in a given `order`. Deals, conversations and support tickets point to their current stage with `pipeline_stage_id`.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/pipeline-stages"
      }
    },
    {
      "name": "Pipelines",
      "description": "A pipeline is an ordered set of [stages](/docs/api-reference/pipeline-stages) used to track deals, conversations or support tickets on a board. The `type` of the pipeline says which records it holds.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/pipelines"
      }
    },
    {
      "name": "Products",
      "description": "Products and services in your organization's catalog. Use them in deals, orders, invoices, the public catalog and AI assistant product search.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/products"
      }
    },
    {
      "name": "Product categories",
      "description": "Categories group the products of your catalog. A product points to its category with `product_category_id`.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/product-categories"
      }
    },
    {
      "name": "Product media",
      "description": "Images and other files attached to a product. The file itself is stored in AchieveApex storage (uploaded with a signed URL); a product media record links it to the product and sets its display order.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/product-media"
      }
    },
    {
      "name": "Reservation available slots",
      "description": "Computes the bookable time slots of a [service](/docs/api-reference/reservation-services) on one date. Use it before [creating a reservation](/docs/api-reference/reservations/create): send the chosen slot's `start_datetime`. It is read-only and calculated on every request; nothing is stored.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/reservation-available-slots"
      }
    },
    {
      "name": "Reservation booking links",
      "description": "A booking link is a public page where customers book your [reservation services](/docs/api-reference/reservation-services) themselves. Each link has a `slug`, a `mode` that decides which services it shows, and a `page_config` with its branding, texts and form. The page is served at `/b/{organization_id}/{slug}` on the AchieveApex web app, and bookings made there are created as [reservations](/docs/api-reference/reservations).",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/reservation-booking-links"
      }
    },
    {
      "name": "Reservation resource availability",
      "description": "Weekly recurring working hours of a [resource](/docs/api-reference/reservation-resources): one row per time block per weekday. A day can have several rows (for example 09:00–12:00 and 13:00–17:00). These rows define the [available slots](/docs/api-reference/reservation-available-slots) of every service the resource is linked to, and a reservation is only accepted on a resource inside one of its blocks.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-availability"
      }
    },
    {
      "name": "Reservation resource exceptions",
      "description": "Date-specific overrides of the weekly [availability](/docs/api-reference/reservation-resource-availability): close a resource (or the whole organization) on a date, or give a resource different hours that day.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-exceptions"
      }
    },
    {
      "name": "Reservation resources",
      "description": "A resource is something a reservation occupies: a person (staff member), a room, a table, a piece of equipment or a vehicle. Resources have a capacity, a weekly [availability](/docs/api-reference/reservation-resource-availability), date [exceptions](/docs/api-reference/reservation-resource-exceptions), and are attached to services through [service resources](/docs/api-reference/reservation-service-resources).",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/reservation-resources"
      }
    },
    {
      "name": "Reservation service resources",
      "description": "A service resource links a [resource](/docs/api-reference/reservation-resources) to a [service](/docs/api-reference/reservation-services) and says how it is used when someone books that service: whether it is required, optional or any resource of the same type, and how much of its capacity one booking takes. Services without links are bookable 08:00–18:00 without resource checks.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/reservation-service-resources"
      }
    },
    {
      "name": "Reservation services",
      "description": "A reservation service is something customers can book (a consultation, a table, a class): its duration, how many bookings fit in one slot, booking-window rules, price and whether it shows on public booking pages. Every [reservation](/docs/api-reference/reservations) belongs to one service.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/reservation-services"
      }
    },
    {
      "name": "Support Tickets",
      "description": "A support ticket is an email thread with a customer in your helpdesk inbox (Gmail or Outlook). Use it to list, create, assign, prioritize and close tickets, move them through ticket pipelines and set their custom fields.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/support-tickets"
      }
    },
    {
      "name": "WhatsApp templates",
      "description": "WhatsApp message templates approved by Meta for your WhatsApp numbers. Templates are needed to write to a contact outside WhatsApp's 24-hour window; send one with [Send a WhatsApp template](/docs/api-reference/conversation-messages/send-whatsapp-template). Templates are created, edited and deleted in the AchieveApex app or in Meta's WhatsApp Manager; the API reads them.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/whatsapp-channel-message-templates"
      }
    },
    {
      "name": "WhatsApp numbers",
      "description": "A WhatsApp channel is one WhatsApp Business number connected to your organization. An organization can connect several numbers; each [conversation](/docs/api-reference/conversations) belongs to one of them (`whatsapp_channel_id`). Numbers are connected and removed in the AchieveApex app (Settings, WhatsApp) because connecting requires Meta's sign-in; the API reads them.",
      "externalDocs": {
        "url": "https://www.achieveapex.com/docs/api-reference/whatsapp-channels"
      }
    }
  ],
  "paths": {
    "/activities": {
      "get": {
        "tags": [
          "Activities"
        ],
        "operationId": "findActivities",
        "summary": "List activities",
        "description": "Returns a paginated list of activities, with optional filters and a free-text search.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/activities/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Activities"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Activities"
        ],
        "operationId": "createActivities",
        "summary": "Create an activity",
        "description": "Creates an activity. See [side effects](/docs/api-reference/activities) for calendar sync, reminders and automations.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/activities/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivitiesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activities"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/activities/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Activities"
        ],
        "operationId": "getActivities",
        "summary": "Get an activity",
        "description": "Returns one activity by ID, with `company`, `assignedTo`, `createdBy`, `deal` and `contact` embedded.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/activities/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activities"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Activities"
        ],
        "operationId": "patchActivities",
        "summary": "Update an activity",
        "description": "Partially updates an activity. Only the fields you send change. Use it to reschedule, reassign or mark an activity as done.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/activities/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivitiesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activities"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Activities"
        ],
        "operationId": "removeActivities",
        "summary": "Delete an activity",
        "description": "Deletes an activity. This is a soft delete: the activity gets a `deleted_at` timestamp and no longer appears in list or get. Its event is removed from the synced external calendar and its pending reminder is cancelled. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/activities/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activities"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/activity-types": {
      "get": {
        "tags": [
          "Activity types"
        ],
        "operationId": "findActivityTypes",
        "summary": "List activity types",
        "description": "Returns a paginated list of activity types.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/activity-types/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ActivityTypes"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Activity types"
        ],
        "operationId": "createActivityTypes",
        "summary": "Create an activity type",
        "description": "Creates an activity type.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/activity-types/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivityTypesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityTypes"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/activity-types/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Activity types"
        ],
        "operationId": "getActivityTypes",
        "summary": "Get an activity type",
        "description": "Returns one activity type by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/activity-types/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityTypes"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Activity types"
        ],
        "operationId": "patchActivityTypes",
        "summary": "Update an activity type",
        "description": "Partially updates an activity type. Only the fields you send change.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/activity-types/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivityTypesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityTypes"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Activity types"
        ],
        "operationId": "removeActivityTypes",
        "summary": "Delete an activity type",
        "description": "Deletes an activity type. This is a soft delete: the type gets a `deleted_at` timestamp and no longer appears in list or get. Existing activities are not changed. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/activity-types/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityTypes"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai-assistant-skills": {
      "get": {
        "tags": [
          "AI Assistant Skills"
        ],
        "operationId": "findAiAssistantSkills",
        "summary": "List skills",
        "description": "Return the skills of your organization, usually filtered by assistant.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistant-skills/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiAssistantSkills"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "AI Assistant Skills"
        ],
        "operationId": "createAiAssistantSkills",
        "summary": "Create a skill",
        "description": "Create a skill and attach it to an assistant.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistant-skills/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAssistantSkillsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistantSkills"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai-assistant-skills/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "AI Assistant Skills"
        ],
        "operationId": "getAiAssistantSkills",
        "summary": "Get a skill",
        "description": "Retrieve one skill by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistant-skills/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistantSkills"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "AI Assistant Skills"
        ],
        "operationId": "patchAiAssistantSkills",
        "summary": "Update a skill",
        "description": "Partially update a skill.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistant-skills/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAssistantSkillsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistantSkills"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "AI Assistant Skills"
        ],
        "operationId": "removeAiAssistantSkills",
        "summary": "Delete a skill",
        "description": "Delete a skill. This is a soft delete: the skill gets `deleted_at` and no longer appears in list or get, and the assistant stops using it. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistant-skills/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistantSkills"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai-assistants": {
      "get": {
        "tags": [
          "AI Assistants"
        ],
        "operationId": "findAiAssistants",
        "summary": "List AI assistants",
        "description": "Return the AI assistants of your organization, with optional filters and pagination.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistants/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiAssistants"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "AI Assistants"
        ],
        "operationId": "createAiAssistants",
        "summary": "Create an AI assistant",
        "description": "Create an assistant for conversations, support tickets, the help desk, internal AI chat or voice calls.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistants/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAssistantsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistants"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai-assistants/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "AI Assistants"
        ],
        "operationId": "getAiAssistants",
        "summary": "Get an AI assistant",
        "description": "Retrieve one AI assistant with its full configuration.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistants/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistants"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "AI Assistants"
        ],
        "operationId": "patchAiAssistants",
        "summary": "Configure a voice assistant",
        "description": "Voice assistants (`assistant_type: \"voice\"`) keep their runtime settings in `telnyx_ai_assistant_config`. You change them with a normal assistant update; after every create or update the voice agent is synced with the voice provider.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistants/voice"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAssistantsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistants"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "AI Assistants"
        ],
        "operationId": "removeAiAssistants",
        "summary": "Delete an AI assistant",
        "description": "Delete an AI assistant. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistants/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistants"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai-assistants-change-history": {
      "get": {
        "tags": [
          "AI Assistants"
        ],
        "operationId": "findAiAssistantsChangeHistory",
        "summary": "List configuration history",
        "description": "Every time a team member creates or updates an assistant in the app, a snapshot of the full configuration is saved. List those snapshots to inspect previous versions or to find what was active at a given time. Changes made with an API key are not recorded.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistants/history"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiAssistantsChangeHistory"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai-assistants-change-history/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "AI Assistants"
        ],
        "operationId": "getAiAssistantsChangeHistory",
        "summary": "Get a history entry",
        "description": "Retrieve one configuration snapshot by ID. See [List configuration history](/docs/api-reference/ai-assistants/history) for the fields.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistants/history-get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAssistantsChangeHistory"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai-assistants-restore-from-changes-history": {
      "post": {
        "tags": [
          "AI Assistants"
        ],
        "operationId": "createAiAssistantsRestoreFromChangesHistory",
        "summary": "Restore a configuration version",
        "description": "Restore an assistant from a [history entry](/docs/api-reference/ai-assistants/history), either only its instructions or its main configuration. The assistant is updated in place; the restore itself is not recorded as a new history entry.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-assistants/restore"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai-models": {
      "get": {
        "tags": [
          "AI Models"
        ],
        "operationId": "findAiModels",
        "summary": "List AI models",
        "description": "Return the AI model catalog, with optional filters and search.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-models/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AiModels"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai-models/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "AI Models"
        ],
        "operationId": "getAiModels",
        "summary": "Get an AI model",
        "description": "Retrieve one AI model by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/ai-models/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiModels"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api-tools": {
      "get": {
        "tags": [
          "API Tools"
        ],
        "operationId": "findApiTools",
        "summary": "List API tools",
        "description": "Return the API tools of your organization.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/api-tools/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiTools"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "API Tools"
        ],
        "operationId": "createApiTools",
        "summary": "Create an API tool",
        "description": "Create a reusable HTTP tool. Attach it to assistants afterwards through their `api_tools` field.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/api-tools/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiToolsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTools"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api-tools/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "API Tools"
        ],
        "operationId": "getApiTools",
        "summary": "Get an API tool",
        "description": "Retrieve one API tool by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/api-tools/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTools"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "API Tools"
        ],
        "operationId": "patchApiTools",
        "summary": "Update an API tool",
        "description": "Partially update an API tool. Assistants that use it pick up the change on their next call.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/api-tools/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiToolsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTools"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "API Tools"
        ],
        "operationId": "removeApiTools",
        "summary": "Delete an API tool",
        "description": "Delete an API tool. This is a soft delete: the tool gets `deleted_at` and no longer appears in list or get. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/api-tools/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTools"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/automations-executions": {
      "post": {
        "tags": [
          "Automation executions"
        ],
        "operationId": "createAutomationsExecutions",
        "summary": "Run an automation",
        "description": "Start a run of an automation with your own input data. By default the request returns immediately with `status: pending` and the automation runs in the background; add `?sync=true` to wait until it finishes.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/automations-executions/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationsExecutionsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationsExecutions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Automation executions"
        ],
        "operationId": "findAutomationsExecutions",
        "summary": "List executions",
        "description": "List automation runs of your organization, for example the runs of one automation or the failed runs of the last day.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/automations-executions/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AutomationsExecutions"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/automations-executions/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Automation executions"
        ],
        "operationId": "getAutomationsExecutions",
        "summary": "Get an execution",
        "description": "Retrieve one automation run by ID. Poll it after [running an automation](/docs/api-reference/automations-executions/create) in the background until `status` is `completed` or `failed`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/automations-executions/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationsExecutions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/campaign-segments": {
      "get": {
        "tags": [
          "Campaign Segments"
        ],
        "operationId": "findCampaignSegments",
        "summary": "List segments",
        "description": "Return the segments of your organization, each with its current `total_persons` count.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/campaign-segments/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CampaignSegments"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/campaign-segments/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Campaign Segments"
        ],
        "operationId": "getCampaignSegments",
        "summary": "Get a segment",
        "description": "Retrieve one segment with its current `total_persons` count.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/campaign-segments/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignSegments"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Campaign Segments"
        ],
        "operationId": "patchCampaignSegments",
        "summary": "Update a segment",
        "description": "Partially update a segment: rename it, change its channel or replace its rules.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/campaign-segments/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignSegmentsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignSegments"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Campaign Segments"
        ],
        "operationId": "removeCampaignSegments",
        "summary": "Delete a segment",
        "description": "Delete a segment. This is a soft delete: the segment gets `deleted_at` and no longer appears in list or get. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/campaign-segments/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignSegments"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/companies": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "findCompanies",
        "summary": "List companies",
        "description": "Returns a paginated list of companies, with optional filters and a name search.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/companies/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Companies"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Companies"
        ],
        "operationId": "createCompanies",
        "summary": "Search companies",
        "description": "Searches companies of one organization by name (case-insensitive, partial match), sorted by name.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/companies/search"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompaniesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Companies"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "x-custom-methods": [
        {
          "method": "search",
          "http": "POST /companies",
          "header": {
            "X-Service-Method": "search"
          },
          "docs": "https://www.achieveapex.com/docs/api-reference/companies"
        }
      ]
    },
    "/companies/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getCompanies",
        "summary": "Get a company",
        "description": "Returns one company by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/companies/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Companies"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Companies"
        ],
        "operationId": "patchCompanies",
        "summary": "Update a company",
        "description": "Partially updates a company. Only the fields you send change.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/companies/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompaniesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Companies"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Companies"
        ],
        "operationId": "removeCompanies",
        "summary": "Delete a company",
        "description": "Deletes a company. This is a soft delete: the company gets a `deleted_at` timestamp and no longer appears in list, get or search. Contacts, deals, activities and notes that pointed to it get `company_id = null`. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/companies/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Companies"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "operationId": "findContacts",
        "summary": "List contacts",
        "description": "Returns a paginated list of contacts, with optional filters, sorting and a free-text search.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/contacts/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Contacts"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "operationId": "createContacts",
        "summary": "Search contacts",
        "description": "Searches contacts of one organization by name, phone, email or a custom field. Same matching as `searchTerm` on [List contacts](/docs/api-reference/contacts/list), but the parameters go in a JSON body.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/contacts/search"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contacts"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "x-custom-methods": [
        {
          "method": "search",
          "http": "POST /contacts",
          "header": {
            "X-Service-Method": "search"
          },
          "docs": "https://www.achieveapex.com/docs/api-reference/contacts"
        }
      ]
    },
    "/contacts/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Contacts"
        ],
        "operationId": "getContacts",
        "summary": "Get a contact",
        "description": "Returns one contact by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/contacts/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contacts"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Contacts"
        ],
        "operationId": "patchContacts",
        "summary": "Update a contact",
        "description": "Partially updates a contact. Only the fields you send change.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/contacts/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contacts"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "operationId": "removeContacts",
        "summary": "Delete a contact",
        "description": "Deletes a contact. This is a soft delete: the contact gets a `deleted_at` timestamp and no longer appears in list, get or search. The contact's conversations are soft-deleted too. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/contacts/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contacts"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/contacts-segments-run-query": {
      "post": {
        "tags": [
          "Campaign Segments"
        ],
        "operationId": "createContactsSegmentsRunQuery",
        "summary": "Preview the contacts of a segment",
        "description": "Return a page of the contacts that currently match a saved segment. Nothing is saved or sent.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/campaign-segments/run-query"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/contacts-segments-schema-builder": {
      "post": {
        "tags": [
          "Campaign Segments"
        ],
        "operationId": "createContactsSegmentsSchemaBuilder",
        "summary": "Get segment fields",
        "description": "Return every field you can filter on in a segment `query`, grouped by entity, with its type, label and allowed operators. Includes your organization's custom fields, tags, team members and conversation events. Nothing is saved.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/campaign-segments/schema-builder"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-files": {
      "post": {
        "tags": [
          "Conversation files"
        ],
        "operationId": "createConversationFiles",
        "summary": "Upload a file",
        "description": "Upload an attachment for an outgoing message in three steps: get a signed upload URL, `PUT` the bytes to it, then register the file on the conversation. Finally send the message with the file fields.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-files/upload"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationFilesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationFiles"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Conversation files"
        ],
        "operationId": "findConversationFiles",
        "summary": "List files",
        "description": "List the files registered on a conversation, for example to build a media gallery of a thread.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-files/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversationFiles"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-files/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Conversation files"
        ],
        "operationId": "getConversationFiles",
        "summary": "Get a file",
        "description": "Retrieve one conversation file by its `_id`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-files/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationFiles"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-initiate-whatsapp": {
      "post": {
        "tags": [
          "Conversations"
        ],
        "operationId": "createConversationInitiateWhatsapp",
        "summary": "Start a WhatsApp conversation",
        "description": "Start (or reuse) the WhatsApp conversation with a contact from one of your WhatsApp numbers. An organization can connect several numbers: each number has its own conversation with the contact, and messages always go out from the conversation's number.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversations/initiate-whatsapp"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-instagram": {
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "findConversationMessagesInstagram",
        "summary": "List messages",
        "description": "Load the message history of a conversation. Call the message service that matches the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversationMessagesInstagram"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-instagram/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "getConversationMessagesInstagram",
        "summary": "Get a message",
        "description": "Retrieve one message by its ID from the message service of the conversation's channel.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesInstagram"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "patchConversationMessagesInstagram",
        "summary": "Edit a note",
        "description": "Rewrite the text of an internal note (`message_type: note`). Only notes can be edited through the API; customer messages cannot be changed.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationMessagesInstagramPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesInstagram"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "removeConversationMessagesInstagram",
        "summary": "Delete a message",
        "description": "Delete one message from the inbox. This is a soft delete: the message gets `deleted_at` and stops appearing in list and get responses. It is **not** deleted from the contact's WhatsApp, Instagram, Messenger or phone. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesInstagram"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-messenger": {
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "findConversationMessagesMessenger",
        "summary": "List messages",
        "description": "Load the message history of a conversation. Call the message service that matches the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversationMessagesMessenger"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-messenger/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "getConversationMessagesMessenger",
        "summary": "Get a message",
        "description": "Retrieve one message by its ID from the message service of the conversation's channel.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesMessenger"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "patchConversationMessagesMessenger",
        "summary": "Edit a note",
        "description": "Rewrite the text of an internal note (`message_type: note`). Only notes can be edited through the API; customer messages cannot be changed.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationMessagesMessengerPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesMessenger"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "removeConversationMessagesMessenger",
        "summary": "Delete a message",
        "description": "Delete one message from the inbox. This is a soft delete: the message gets `deleted_at` and stops appearing in list and get responses. It is **not** deleted from the contact's WhatsApp, Instagram, Messenger or phone. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesMessenger"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-playground": {
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "findConversationMessagesPlayground",
        "summary": "List messages",
        "description": "Load the message history of a conversation. Call the message service that matches the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversationMessagesPlayground"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "createConversationMessagesPlayground",
        "summary": "Send a message",
        "description": "Send a message to the contact of a conversation, or store an internal note. Use the send service of the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/send"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationMessagesPlaygroundData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesPlayground"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-playground/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "getConversationMessagesPlayground",
        "summary": "Get a message",
        "description": "Retrieve one message by its ID from the message service of the conversation's channel.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesPlayground"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "patchConversationMessagesPlayground",
        "summary": "Edit a note",
        "description": "Rewrite the text of an internal note (`message_type: note`). Only notes can be edited through the API; customer messages cannot be changed.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationMessagesPlaygroundPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesPlayground"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "removeConversationMessagesPlayground",
        "summary": "Delete a message",
        "description": "Delete one message from the inbox. This is a soft delete: the message gets `deleted_at` and stops appearing in list and get responses. It is **not** deleted from the contact's WhatsApp, Instagram, Messenger or phone. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesPlayground"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-sms": {
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "findConversationMessagesSms",
        "summary": "List messages",
        "description": "Load the message history of a conversation. Call the message service that matches the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversationMessagesSms"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "createConversationMessagesSms",
        "summary": "Send a message",
        "description": "Send a message to the contact of a conversation, or store an internal note. Use the send service of the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/send"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationMessagesSmsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesSms"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-sms/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "getConversationMessagesSms",
        "summary": "Get a message",
        "description": "Retrieve one message by its ID from the message service of the conversation's channel.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesSms"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "removeConversationMessagesSms",
        "summary": "Delete a message",
        "description": "Delete one message from the inbox. This is a soft delete: the message gets `deleted_at` and stops appearing in list and get responses. It is **not** deleted from the contact's WhatsApp, Instagram, Messenger or phone. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesSms"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-transform-outgoing-instagram": {
      "post": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "createConversationMessagesTransformOutgoingInstagram",
        "summary": "Send a message",
        "description": "Send a message to the contact of a conversation, or store an internal note. Use the send service of the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/send"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-transform-outgoing-messenger": {
      "post": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "createConversationMessagesTransformOutgoingMessenger",
        "summary": "Send a message",
        "description": "Send a message to the contact of a conversation, or store an internal note. Use the send service of the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/send"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-transform-outgoing-webchat": {
      "post": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "createConversationMessagesTransformOutgoingWebchat",
        "summary": "Send a message",
        "description": "Send a message to the contact of a conversation, or store an internal note. Use the send service of the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/send"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-transform-outgoing-whatsapp": {
      "post": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "createConversationMessagesTransformOutgoingWhatsapp",
        "summary": "Send a message",
        "description": "Send a message to the contact of a conversation, or store an internal note. Use the send service of the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/send"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-webchat": {
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "findConversationMessagesWebchat",
        "summary": "List messages",
        "description": "Load the message history of a conversation. Call the message service that matches the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversationMessagesWebchat"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-webchat/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "getConversationMessagesWebchat",
        "summary": "Get a message",
        "description": "Retrieve one message by its ID from the message service of the conversation's channel.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesWebchat"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "patchConversationMessagesWebchat",
        "summary": "Edit a note",
        "description": "Rewrite the text of an internal note (`message_type: note`). Only notes can be edited through the API; customer messages cannot be changed.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationMessagesWebchatPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesWebchat"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "removeConversationMessagesWebchat",
        "summary": "Delete a message",
        "description": "Delete one message from the inbox. This is a soft delete: the message gets `deleted_at` and stops appearing in list and get responses. It is **not** deleted from the contact's WhatsApp, Instagram, Messenger or phone. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesWebchat"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-whatsapp": {
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "findConversationMessagesWhatsapp",
        "summary": "List messages",
        "description": "Load the message history of a conversation. Call the message service that matches the conversation's `channel`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversationMessagesWhatsapp"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-messages-whatsapp/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "getConversationMessagesWhatsapp",
        "summary": "Get a message",
        "description": "Retrieve one message by its ID from the message service of the conversation's channel.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesWhatsapp"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "patchConversationMessagesWhatsapp",
        "summary": "Edit a note",
        "description": "Rewrite the text of an internal note (`message_type: note`). Only notes can be edited through the API; customer messages cannot be changed.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationMessagesWhatsappPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesWhatsapp"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Conversation messages"
        ],
        "operationId": "removeConversationMessagesWhatsapp",
        "summary": "Delete a message",
        "description": "Delete one message from the inbox. This is a soft delete: the message gets `deleted_at` and stops appearing in list and get responses. It is **not** deleted from the contact's WhatsApp, Instagram, Messenger or phone. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-messages/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesWhatsapp"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-predefined-messages": {
      "get": {
        "tags": [
          "Predefined messages"
        ],
        "operationId": "findConversationPredefinedMessages",
        "summary": "List predefined messages",
        "description": "List the organization's canned replies.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-predefined-messages/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversationPredefinedMessages"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Predefined messages"
        ],
        "operationId": "createConversationPredefinedMessages",
        "summary": "Create a predefined message",
        "description": "Create a canned reply for the organization. The author (`created_by_user_id`) is always the API key's user.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-predefined-messages/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationPredefinedMessagesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationPredefinedMessages"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversation-predefined-messages/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Predefined messages"
        ],
        "operationId": "getConversationPredefinedMessages",
        "summary": "Get a predefined message",
        "description": "Retrieve one canned reply by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-predefined-messages/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationPredefinedMessages"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Predefined messages"
        ],
        "operationId": "patchConversationPredefinedMessages",
        "summary": "Update a predefined message",
        "description": "Partially update a canned reply. Only its author or an owner/admin of the organization can update it. `id`, `organization_id` and `created_by_user_id` are ignored if sent.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-predefined-messages/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationPredefinedMessagesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationPredefinedMessages"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Predefined messages"
        ],
        "operationId": "removeConversationPredefinedMessages",
        "summary": "Delete a predefined message",
        "description": "Delete a canned reply. This is a soft delete: the record gets `deleted_at` and no longer appears in list or get responses. Only its author or an owner/admin of the organization can delete it. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversation-predefined-messages/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationPredefinedMessages"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversations": {
      "get": {
        "tags": [
          "Conversations"
        ],
        "operationId": "findConversations",
        "summary": "List conversations",
        "description": "List the conversations of your organization with filters, text search and pagination. This is the same query the inbox and the conversation pipeline board use.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversations/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Conversations"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Conversations"
        ],
        "operationId": "createConversations",
        "summary": "Create a conversation",
        "description": "Create a conversation record. Use it for **AI assistant playground** threads (test an assistant through the API). To write to a contact on WhatsApp use [Start a WhatsApp conversation](/docs/api-reference/conversations/initiate-whatsapp) instead: it picks the WhatsApp number and fills the channel identifiers for you.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversations/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversations"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversations/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Conversations"
        ],
        "operationId": "getConversations",
        "summary": "Get a conversation",
        "description": "Retrieve one conversation by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversations/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversations"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Conversations"
        ],
        "operationId": "patchConversations",
        "summary": "Update a conversation",
        "description": "Partially update one conversation: open or close it, assign a human or an AI assistant, move it in a pipeline, mark it read or unread, cut the AI context, pin messages or block it. Send only the fields you want to change.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversations/patch"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversations"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Conversations"
        ],
        "operationId": "removeConversations",
        "summary": "Delete a conversation",
        "description": "Delete a conversation. This is a soft delete: the record gets `deleted_at` and no longer appears in list or get responses. Its messages are kept. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversations/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversations"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversations-bulk-actions": {
      "post": {
        "tags": [
          "Conversations"
        ],
        "operationId": "createConversationsBulkActions",
        "summary": "Run a bulk action on conversations",
        "description": "Apply the same change to many conversations in one request: assign an owner, change status, assign an AI assistant, move them in a pipeline, or cut the AI context. The action runs during the request and the response is the bulk action record with its result counts.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversations/bulk-actions"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationsBulkActionsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationsBulkActions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Conversations"
        ],
        "operationId": "findConversationsBulkActions",
        "summary": "List bulk actions",
        "description": "List the conversation bulk actions run in your organization, newest first if you sort by `created_at`. Useful as an audit log of mass changes.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversations/bulk-actions-list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversationsBulkActions"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversations-bulk-actions/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Conversations"
        ],
        "operationId": "getConversationsBulkActions",
        "summary": "Get a bulk action",
        "description": "Retrieve one conversation bulk action by ID, for example to read its `processed_count` and `error_message`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/conversations/bulk-actions-get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationsBulkActions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/custom-fields": {
      "get": {
        "tags": [
          "Custom fields"
        ],
        "operationId": "findCustomFields",
        "summary": "List custom fields",
        "description": "Returns the custom fields of your organization, sorted by `position` by default.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/custom-fields/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomFields"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Custom fields"
        ],
        "operationId": "createCustomFields",
        "summary": "Create a custom field",
        "description": "Creates a custom field for one entity type.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/custom-fields/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFieldsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFields"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/custom-fields/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Custom fields"
        ],
        "operationId": "getCustomFields",
        "summary": "Get a custom field",
        "description": "Returns one custom field by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/custom-fields/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFields"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Custom fields"
        ],
        "operationId": "patchCustomFields",
        "summary": "Update a custom field",
        "description": "Partially updates a custom field. `key` cannot be changed (it is ignored), so values already stored on records keep working.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/custom-fields/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFieldsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFields"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Custom fields"
        ],
        "operationId": "removeCustomFields",
        "summary": "Delete a custom field",
        "description": "Deletes a custom field. This is a soft delete: the field gets a `deleted_at` timestamp and no longer appears in list or get. Its key stays reserved, so a new field with the same name gets a different key. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/custom-fields/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFields"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deal-products": {
      "get": {
        "tags": [
          "Deal products"
        ],
        "operationId": "findDealProducts",
        "summary": "List deal products",
        "description": "Returns a paginated list of deal product lines.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/deal-products/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DealProducts"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Deal products"
        ],
        "operationId": "createDealProducts",
        "summary": "Add a product to a deal",
        "description": "Creates a line item on a deal. Afterwards the deal's `amount` is recalculated as the sum of `total_amount_with_tax` of all its lines.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/deal-products/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealProductsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealProducts"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deal-products/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Deal products"
        ],
        "operationId": "getDealProducts",
        "summary": "Get a deal product",
        "description": "Returns one deal product line by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/deal-products/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealProducts"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Deal products"
        ],
        "operationId": "patchDealProducts",
        "summary": "Update a deal product",
        "description": "Partially updates a deal product line. The deal's `amount` is recalculated afterwards. If you change quantity, price, discount or tax, also send the new `total_amount_without_tax` and `total_amount_with_tax`: the API does not recalculate them.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/deal-products/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealProductsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealProducts"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Deal products"
        ],
        "operationId": "removeDealProducts",
        "summary": "Remove a product from a deal",
        "description": "Deletes a deal product line. This is a soft delete: the line gets a `deleted_at` timestamp and no longer appears in list or get. The deal's `amount` is recalculated without it. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/deal-products/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealProducts"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deals": {
      "get": {
        "tags": [
          "Deals"
        ],
        "operationId": "findDeals",
        "summary": "List deals",
        "description": "Returns a paginated list of deals, with optional filters.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/deals/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Deals"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Deals"
        ],
        "operationId": "createDeals",
        "summary": "Create a deal",
        "description": "Creates a deal in a pipeline stage.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/deals/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deals"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Deals"
        ],
        "operationId": "getDeals",
        "summary": "Get a deal",
        "description": "Returns one deal by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/deals/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deals"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Deals"
        ],
        "operationId": "patchDeals",
        "summary": "Update a deal",
        "description": "Partially updates a deal. Use it to move a deal to another stage, mark it won or lost, or change its data.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/deals/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deals"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Deals"
        ],
        "operationId": "removeDeals",
        "summary": "Delete a deal",
        "description": "Deletes a deal. This is a soft delete: the deal gets a `deleted_at` timestamp and no longer appears in list or get. Its activities are deleted too and its watchers are removed. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/deals/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deals"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/export-data": {
      "post": {
        "tags": [
          "Export data"
        ],
        "operationId": "createExportData",
        "summary": "Export data",
        "description": "Generates a spreadsheet with the records of one type and returns its download URL. Large exports can take a while; keep the request open until it answers.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/export-data/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-actions": {
      "post": {
        "tags": [
          "Loyalty actions"
        ],
        "operationId": "createLoyaltyActions",
        "summary": "Get wallet links",
        "description": "Get the links of a card: the private card page and the links to add the card to Apple Wallet and Google Wallet. Use them to show the card in your app or send it to the customer.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-actions/wallet-links"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-members": {
      "get": {
        "tags": [
          "Loyalty members"
        ],
        "operationId": "findLoyaltyMembers",
        "summary": "List or look up loyalty members",
        "description": "Retrieve the loyalty cards of your organization, or find one card by phone, email or card code.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-members/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LoyaltyMembers"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Loyalty members"
        ],
        "operationId": "createLoyaltyMembers",
        "summary": "Enroll a loyalty member",
        "description": "Enroll a customer in a loyalty program and get their card. Use an existing contact (`contact_id`) or send the customer's details (`contact`) and AchieveApex finds the contact by email or phone, or creates it.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-members/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyMembersData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyMembers"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-members/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Loyalty members"
        ],
        "operationId": "getLoyaltyMembers",
        "summary": "Get a loyalty member",
        "description": "Retrieve a single loyalty card by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-members/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyMembers"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Loyalty members"
        ],
        "operationId": "patchLoyaltyMembers",
        "summary": "Update a loyalty member",
        "description": "Block or reactivate a card, change its expiry, consent or metadata. Balances cannot be changed here: use [Loyalty Actions](/docs/api-reference/loyalty-actions) or a [manual adjustment](/docs/api-reference/loyalty-transactions/create).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-members/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyMembersPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyMembers"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Loyalty members"
        ],
        "operationId": "removeLoyaltyMembers",
        "summary": "Delete a loyalty member",
        "description": "Delete a loyalty card. This is a soft delete: the card gets `deleted_at`, no longer appears in list or get, and stops working. To stop a card temporarily, [block it](/docs/api-reference/loyalty-members/update) with `\"status\": \"blocked\"` instead. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-members/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyMembers"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-programs": {
      "get": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "findLoyaltyPrograms",
        "summary": "List loyalty programs",
        "description": "Retrieve the loyalty programs of your organization with optional filtering, search and pagination.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-programs/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LoyaltyPrograms"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "createLoyaltyPrograms",
        "summary": "Create a loyalty program",
        "description": "Create a stamp card, points program, cashback program, membership or gift card. New programs start as `draft`: activate them with `\"status\": \"active\"` (here or later with an update).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-programs/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyProgramsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyPrograms"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-programs/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "getLoyaltyPrograms",
        "summary": "Get a loyalty program",
        "description": "Retrieve a single loyalty program by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-programs/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyPrograms"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "patchLoyaltyPrograms",
        "summary": "Update a loyalty program",
        "description": "Change a program's settings (partial update), for example to activate, pause or archive it, or to change its earning rules or card design.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-programs/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyProgramsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyPrograms"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "removeLoyaltyPrograms",
        "summary": "Delete a loyalty program",
        "description": "Delete a program that has no members. This is a soft delete: the program gets `deleted_at` and no longer appears in list or get. A program with members cannot be deleted: [archive it](/docs/api-reference/loyalty-programs/update) with `\"status\": \"archived\"` instead. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-programs/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyPrograms"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-redemptions": {
      "get": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "findLoyaltyRedemptions",
        "summary": "List loyalty redemptions",
        "description": "Retrieve reward codes, or find one by code.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-redemptions/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LoyaltyRedemptions"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "createLoyaltyRedemptions",
        "summary": "Redeem a reward",
        "description": "Spend a card balance and issue a reward code. Send `reward_id` to redeem a catalog reward (points and stamps programs), or `amount` to spend money from a cashback or gift card balance.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-redemptions/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyRedemptionsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyRedemptions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-redemptions/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "getLoyaltyRedemptions",
        "summary": "Get a loyalty redemption",
        "description": "Retrieve one redemption (reward code) by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-redemptions/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyRedemptions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "patchLoyaltyRedemptions",
        "summary": "Use or cancel a redemption",
        "description": "Mark a reward code as used when the reward is handed over, or cancel it to give the balance back to the card.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-redemptions/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyRedemptionsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyRedemptions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-reports": {
      "get": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "findLoyaltyReports",
        "summary": "find loyalty-reports",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-rewards": {
      "get": {
        "tags": [
          "Loyalty rewards"
        ],
        "operationId": "findLoyaltyRewards",
        "summary": "List loyalty rewards",
        "description": "Retrieve the rewards of a loyalty program.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-rewards/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LoyaltyRewards"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Loyalty rewards"
        ],
        "operationId": "createLoyaltyRewards",
        "summary": "Create a loyalty reward",
        "description": "Add a reward to a program's catalog.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-rewards/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyRewardsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyRewards"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-rewards/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Loyalty rewards"
        ],
        "operationId": "getLoyaltyRewards",
        "summary": "Get a loyalty reward",
        "description": "Retrieve a single reward by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-rewards/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyRewards"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Loyalty rewards"
        ],
        "operationId": "patchLoyaltyRewards",
        "summary": "Update a loyalty reward",
        "description": "Change a reward (partial update), for example its cost, stock or status.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-rewards/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyRewardsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyRewards"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Loyalty rewards"
        ],
        "operationId": "removeLoyaltyRewards",
        "summary": "Delete a loyalty reward",
        "description": "Delete a reward from the catalog. This is a soft delete: the reward gets `deleted_at` and no longer appears in list or get. To hide it temporarily, set `\"status\": \"inactive\"` instead. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-rewards/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyRewards"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-tiers": {
      "get": {
        "tags": [
          "Loyalty tiers"
        ],
        "operationId": "findLoyaltyTiers",
        "summary": "List loyalty tiers",
        "description": "Retrieve the tiers of a loyalty program.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-tiers/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LoyaltyTiers"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Loyalty tiers"
        ],
        "operationId": "createLoyaltyTiers",
        "summary": "Create a loyalty tier",
        "description": "Add a tier to a loyalty program. Tiers only affect members when the program has `tiers_enabled: true` (points, stamps and cashback programs).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-tiers/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyTiersData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyTiers"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-tiers/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Loyalty tiers"
        ],
        "operationId": "getLoyaltyTiers",
        "summary": "Get a loyalty tier",
        "description": "Retrieve one tier by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-tiers/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyTiers"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Loyalty tiers"
        ],
        "operationId": "patchLoyaltyTiers",
        "summary": "Update a loyalty tier",
        "description": "Change a tier's name, threshold, multiplier, benefits, color or order (partial update).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-tiers/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyTiersPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyTiers"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Loyalty tiers"
        ],
        "operationId": "removeLoyaltyTiers",
        "summary": "Delete a loyalty tier",
        "description": "Delete a tier. This is a soft delete: the tier gets `deleted_at` and no longer appears in list or get. Members of the program are re-evaluated in the background. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-tiers/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyTiers"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-transactions": {
      "get": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "findLoyaltyTransactions",
        "summary": "List loyalty transactions",
        "description": "Retrieve the balance history of a card or of your whole organization.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-transactions/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LoyaltyTransactions"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "createLoyaltyTransactions",
        "summary": "Adjust a balance",
        "description": "Add or remove balance on a card manually, for example to fix a mistake or grant a goodwill bonus. To register a purchase with the program earning rules, use [Register a Purchase](/docs/api-reference/loyalty-actions/register-purchase) instead.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-transactions/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyTransactionsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyTransactions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/loyalty-transactions/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Loyalty programs"
        ],
        "operationId": "getLoyaltyTransactions",
        "summary": "Get a loyalty transaction",
        "description": "Retrieve one balance movement by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/loyalty-transactions/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoyaltyTransactions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mcp-tool-connection-proxy": {
      "post": {
        "tags": [
          "MCP Tool Connections"
        ],
        "operationId": "createMcpToolConnectionProxy",
        "summary": "Test an MCP connection",
        "description": "Connect to an MCP server with the given credentials, call `tools/list`, and return the tools it offers. Nothing is saved.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/mcp-tool-connections/test"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/organizations": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "operationId": "findOrganizations",
        "summary": "List organizations",
        "description": "Returns the organizations the API key's user belongs to.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/organizations/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Organizations"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Organizations"
        ],
        "operationId": "getOrganizations",
        "summary": "Get an organization",
        "description": "Returns one organization by ID, plus its current API rate limit and automation usage.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/organizations/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organizations"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Organizations"
        ],
        "operationId": "patchOrganizations",
        "summary": "Update an organization",
        "description": "Partially updates an organization's settings.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/organizations/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organizations"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/organizations-users-invites": {
      "get": {
        "tags": [
          "Organization invitations"
        ],
        "operationId": "findOrganizationsUsersInvites",
        "summary": "List invitations",
        "description": "Returns a paginated list of invitations.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/organizations-users-invites/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/OrganizationsUsersInvites"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Organization invitations"
        ],
        "operationId": "createOrganizationsUsersInvites",
        "summary": "Create an invitation",
        "description": "Invites a person by email to join the organization. The API sets `status` to `pending` and `expires_at` to 24 hours from now, and emails the person a link to accept.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/organizations-users-invites/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationsUsersInvitesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationsUsersInvites"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/organizations-users-invites/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Organization invitations"
        ],
        "operationId": "getOrganizationsUsersInvites",
        "summary": "Get an invitation",
        "description": "Returns one invitation by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/organizations-users-invites/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationsUsersInvites"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Organization invitations"
        ],
        "operationId": "patchOrganizationsUsersInvites",
        "summary": "Update an invitation",
        "description": "Partially updates a pending invitation, for example to change the role or the pre-filled name before the person accepts. `organization_id`, `created_by_user_id` and the invitation token cannot be changed.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/organizations-users-invites/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationsUsersInvitesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationsUsersInvites"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Organization invitations"
        ],
        "operationId": "removeOrganizationsUsersInvites",
        "summary": "Cancel an invitation",
        "description": "Cancels an invitation. This is a soft delete: the invitation gets a `deleted_at` timestamp and no longer appears in list or get. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/organizations-users-invites/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationsUsersInvites"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pipeline-stages": {
      "get": {
        "tags": [
          "Pipeline stages"
        ],
        "operationId": "findPipelineStages",
        "summary": "List pipeline stages",
        "description": "Returns stages, usually those of one pipeline sorted by `order`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/pipeline-stages/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PipelineStages"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Pipeline stages"
        ],
        "operationId": "createPipelineStages",
        "summary": "Create a pipeline stage",
        "description": "Adds a stage to a pipeline. To append it at the end, set `order` to the current number of stages.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/pipeline-stages/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PipelineStagesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineStages"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pipeline-stages/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Pipeline stages"
        ],
        "operationId": "getPipelineStages",
        "summary": "Get a pipeline stage",
        "description": "Returns one stage by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/pipeline-stages/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineStages"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Pipeline stages"
        ],
        "operationId": "patchPipelineStages",
        "summary": "Update a pipeline stage",
        "description": "Partially updates a stage: rename it, change `rotting_days`, or change `order` when reordering columns (patch each stage with its new index).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/pipeline-stages/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PipelineStagesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineStages"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pipeline stages"
        ],
        "operationId": "removePipelineStages",
        "summary": "Delete a pipeline stage",
        "description": "Deletes a stage. This is a soft delete: the stage gets a `deleted_at` timestamp and no longer appears in list or get. What happens to the records in the stage depends on the pipeline type: Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/pipeline-stages/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PipelineStages"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pipelines": {
      "get": {
        "tags": [
          "Pipelines"
        ],
        "operationId": "findPipelines",
        "summary": "List pipelines",
        "description": "Returns the pipelines the API key's user can see.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/pipelines/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Pipelines"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Pipelines"
        ],
        "operationId": "createPipelines",
        "summary": "Create a pipeline",
        "description": "Creates a pipeline. Add its columns afterwards with [Create a pipeline stage](/docs/api-reference/pipeline-stages/create).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/pipelines/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PipelinesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pipelines"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pipelines/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Pipelines"
        ],
        "operationId": "getPipelines",
        "summary": "Get a pipeline",
        "description": "Returns one pipeline by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/pipelines/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pipelines"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Pipelines"
        ],
        "operationId": "patchPipelines",
        "summary": "Update a pipeline",
        "description": "Partially updates a pipeline, e.g. to rename it, change its visibility or its `config`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/pipelines/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PipelinesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pipelines"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pipelines"
        ],
        "operationId": "removePipelines",
        "summary": "Delete a pipeline",
        "description": "Deletes a pipeline. This is a soft delete: the pipeline gets a `deleted_at` timestamp and no longer appears in list or get. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/pipelines/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pipelines"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "operationId": "findProducts",
        "summary": "List products",
        "description": "Retrieve your organization's products, with filters, text search and pagination.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/products/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Products"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "operationId": "createProducts",
        "summary": "Create a product",
        "description": "Add a product or service to your organization's catalog.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/products/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Products"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Products"
        ],
        "operationId": "getProducts",
        "summary": "Get a product",
        "description": "Retrieve one product by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/products/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Products"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Products"
        ],
        "operationId": "patchProducts",
        "summary": "Update a product",
        "description": "Change some fields of a product (partial update).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/products/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Products"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "operationId": "removeProducts",
        "summary": "Delete a product",
        "description": "Delete a product. This is a soft delete: the product gets `deleted_at` and no longer appears in list or get. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/products/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Products"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products-categories": {
      "get": {
        "tags": [
          "Product categories"
        ],
        "operationId": "findProductsCategories",
        "summary": "List product categories",
        "description": "Retrieve your organization's product categories.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/product-categories/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProductsCategories"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Product categories"
        ],
        "operationId": "createProductsCategories",
        "summary": "Create a product category",
        "description": "Create a category for your products.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/product-categories/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsCategoriesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsCategories"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products-categories/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Product categories"
        ],
        "operationId": "getProductsCategories",
        "summary": "Get a product category",
        "description": "Retrieve one product category by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/product-categories/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsCategories"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Product categories"
        ],
        "operationId": "patchProductsCategories",
        "summary": "Update a product category",
        "description": "Rename a product category (partial update).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/product-categories/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsCategoriesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsCategories"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Product categories"
        ],
        "operationId": "removeProductsCategories",
        "summary": "Delete a product category",
        "description": "Delete a product category. This is a soft delete: the category gets `deleted_at` and no longer appears in list or get. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/product-categories/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsCategories"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products-media": {
      "get": {
        "tags": [
          "Product media"
        ],
        "operationId": "findProductsMedia",
        "summary": "List product media",
        "description": "Retrieve the media items of your organization, usually filtered by product.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/product-media/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProductsMedia"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Product media"
        ],
        "operationId": "createProductsMedia",
        "summary": "Upload product media",
        "description": "Attach a file to a product. Uploading is three steps: get a signed upload URL, upload the file to it, then create the media record.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/product-media/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsMediaData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsMedia"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products-media/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Product media"
        ],
        "operationId": "getProductsMedia",
        "summary": "Get a product media item",
        "description": "Retrieve one product media item by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/product-media/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsMedia"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Product media"
        ],
        "operationId": "patchProductsMedia",
        "summary": "Update product media",
        "description": "Change a media item, usually its `position` to reorder a product's images (partial update).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/product-media/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductsMediaPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsMedia"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Product media"
        ],
        "operationId": "removeProductsMedia",
        "summary": "Delete product media",
        "description": "Delete a media item. The record is soft deleted (it gets `deleted_at` and no longer appears in list or get) and the stored file is removed. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/product-media/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductsMedia"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-available-slots": {
      "get": {
        "tags": [
          "Reservation available slots"
        ],
        "operationId": "findReservationAvailableSlots",
        "summary": "Get available slots",
        "description": "Returns the slots of one service on one date. The response is a single object, not a paginated list.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-available-slots/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-booking-links": {
      "get": {
        "tags": [
          "Reservation booking links"
        ],
        "operationId": "findReservationBookingLinks",
        "summary": "List reservation booking links",
        "description": "Returns a paginated list of the organization's booking links.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-booking-links/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReservationBookingLinks"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Reservation booking links"
        ],
        "operationId": "createReservationBookingLinks",
        "summary": "Create a reservation booking link",
        "description": "Creates a public booking page. It is live at `/b/{organization_id}/{slug}` on the AchieveApex web app as soon as it is created with `is_active: true`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-booking-links/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationBookingLinksData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationBookingLinks"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-booking-links/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Reservation booking links"
        ],
        "operationId": "getReservationBookingLinks",
        "summary": "Get a reservation booking link",
        "description": "Returns one booking link by ID, including its full `page_config`.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-booking-links/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationBookingLinks"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Reservation booking links"
        ],
        "operationId": "patchReservationBookingLinks",
        "summary": "Update a reservation booking link",
        "description": "Partially updates a booking link. Only the top-level fields you send change, but `page_config`, `settings` and `tracking_config` are each **replaced as a whole**: [get the link](/docs/api-reference/reservation-booking-links/get), change the keys you need and send the complete object.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-booking-links/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationBookingLinksPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationBookingLinks"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Reservation booking links"
        ],
        "operationId": "removeReservationBookingLinks",
        "summary": "Delete a reservation booking link",
        "description": "Deletes a booking link; its public page stops working. This is a soft delete: the record gets `deleted_at` and no longer appears in list or get. Its slug cannot be reused by another link of the organization. To take the page offline temporarily, [update](/docs/api-reference/reservation-booking-links/update) it with `is_active: false` instead. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-booking-links/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationBookingLinks"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-resource-availability": {
      "get": {
        "tags": [
          "Reservation resource availability"
        ],
        "operationId": "findReservationResourceAvailability",
        "summary": "List reservation resource availability",
        "description": "Returns a paginated list of weekly availability blocks. Filter by `resource_id` to get one resource's schedule.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-availability/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReservationResourceAvailability"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Reservation resource availability"
        ],
        "operationId": "createReservationResourceAvailability",
        "summary": "Create a reservation resource availability block",
        "description": "Adds a weekly time block to a resource. Send one request per block (for example Monday 09:00–12:00 and Monday 13:00–17:00 are two blocks).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-availability/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationResourceAvailabilityData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResourceAvailability"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-resource-availability/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Reservation resource availability"
        ],
        "operationId": "getReservationResourceAvailability",
        "summary": "Get a reservation resource availability block",
        "description": "Returns one weekly availability block by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-availability/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResourceAvailability"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Reservation resource availability"
        ],
        "operationId": "patchReservationResourceAvailability",
        "summary": "Update a reservation resource availability block",
        "description": "Partially updates one weekly availability block. Only the fields you send change.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-availability/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationResourceAvailabilityPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResourceAvailability"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Reservation resource availability"
        ],
        "operationId": "removeReservationResourceAvailability",
        "summary": "Delete a reservation resource availability block",
        "description": "Removes a weekly availability block. This is a soft delete: the record gets `deleted_at` and no longer appears in list or get, and its hours stop producing slots. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-availability/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResourceAvailability"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-resource-exceptions": {
      "get": {
        "tags": [
          "Reservation resource exceptions"
        ],
        "operationId": "findReservationResourceExceptions",
        "summary": "List reservation resource exceptions",
        "description": "Returns a paginated list of date exceptions.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-exceptions/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReservationResourceExceptions"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Reservation resource exceptions"
        ],
        "operationId": "createReservationResourceExceptions",
        "summary": "Create a reservation resource exception",
        "description": "Adds a date exception for a resource or for the whole organization.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-exceptions/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationResourceExceptionsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResourceExceptions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-resource-exceptions/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Reservation resource exceptions"
        ],
        "operationId": "getReservationResourceExceptions",
        "summary": "Get a reservation resource exception",
        "description": "Returns one date exception by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-exceptions/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResourceExceptions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Reservation resource exceptions"
        ],
        "operationId": "patchReservationResourceExceptions",
        "summary": "Update a reservation resource exception",
        "description": "Partially updates a date exception. Only the fields you send change.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-exceptions/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationResourceExceptionsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResourceExceptions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Reservation resource exceptions"
        ],
        "operationId": "removeReservationResourceExceptions",
        "summary": "Delete a reservation resource exception",
        "description": "Removes a date exception, restoring the weekly hours on that date. This is a soft delete: the record gets `deleted_at` and no longer appears in list or get. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resource-exceptions/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResourceExceptions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-resources": {
      "get": {
        "tags": [
          "Reservation resources"
        ],
        "operationId": "findReservationResources",
        "summary": "List reservation resources",
        "description": "Returns a paginated list of the organization's reservation resources.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resources/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReservationResources"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Reservation resources"
        ],
        "operationId": "createReservationResources",
        "summary": "Create a reservation resource",
        "description": "Creates a bookable resource. Give it weekly hours with [resource availability](/docs/api-reference/reservation-resource-availability/create) and attach it to services with [service resources](/docs/api-reference/reservation-service-resources/create); a resource without availability is never free.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resources/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationResourcesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResources"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-resources/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Reservation resources"
        ],
        "operationId": "getReservationResources",
        "summary": "Get a reservation resource",
        "description": "Returns one reservation resource by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resources/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResources"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Reservation resources"
        ],
        "operationId": "patchReservationResources",
        "summary": "Update a reservation resource",
        "description": "Partially updates a reservation resource. Only the fields you send change.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resources/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationResourcesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResources"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Reservation resources"
        ],
        "operationId": "removeReservationResources",
        "summary": "Delete a reservation resource",
        "description": "Deletes a reservation resource. This is a soft delete: the record gets `deleted_at` and no longer appears in list or get. Its availability rows, exceptions and service links are not deleted automatically; delete them with their own endpoints, or set `is_active: false` on the resource instead. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-resources/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResources"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-service-resources": {
      "get": {
        "tags": [
          "Reservation service resources"
        ],
        "operationId": "findReservationServiceResources",
        "summary": "List reservation service resources",
        "description": "Returns a paginated list of service-resource links. Filter by `service_id` to see the resources of one service, or by `resource_id` to see the services a resource serves.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-service-resources/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReservationServiceResources"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Reservation service resources"
        ],
        "operationId": "createReservationServiceResources",
        "summary": "Create a reservation service resource",
        "description": "Links a resource to a service.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-service-resources/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationServiceResourcesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationServiceResources"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-service-resources/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Reservation service resources"
        ],
        "operationId": "getReservationServiceResources",
        "summary": "Get a reservation service resource",
        "description": "Returns one service-resource link by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-service-resources/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationServiceResources"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Reservation service resources"
        ],
        "operationId": "patchReservationServiceResources",
        "summary": "Update a reservation service resource",
        "description": "Partially updates a service-resource link. Only the fields you send change.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-service-resources/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationServiceResourcesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationServiceResources"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Reservation service resources"
        ],
        "operationId": "removeReservationServiceResources",
        "summary": "Delete a reservation service resource",
        "description": "Unlinks a resource from a service. This is a soft delete: the record gets `deleted_at` and no longer appears in list or get. Existing reservations keep their assigned resources. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-service-resources/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationServiceResources"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-services": {
      "get": {
        "tags": [
          "Reservation services"
        ],
        "operationId": "findReservationServices",
        "summary": "List reservation services",
        "description": "Returns a paginated list of the organization's reservation services.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-services/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReservationServices"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Reservation services"
        ],
        "operationId": "createReservationServices",
        "summary": "Create a reservation service",
        "description": "Creates a bookable service.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-services/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationServicesData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationServices"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservation-services/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Reservation services"
        ],
        "operationId": "getReservationServices",
        "summary": "Get a reservation service",
        "description": "Returns one reservation service by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-services/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationServices"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Reservation services"
        ],
        "operationId": "patchReservationServices",
        "summary": "Update a reservation service",
        "description": "Partially updates a reservation service. Only the fields you send change. Existing reservations keep their stored `end_datetime` when `duration_minutes` changes.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-services/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationServicesPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationServices"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Reservation services"
        ],
        "operationId": "removeReservationServices",
        "summary": "Delete a reservation service",
        "description": "Deletes a reservation service. This is a soft delete: the record gets `deleted_at` and no longer appears in list or get. Existing reservations of the service are not changed. To stop new bookings but keep the service visible to your team, [update](/docs/api-reference/reservation-services/update) it with `is_active: false` instead. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservation-services/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationServices"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservations": {
      "get": {
        "tags": [
          "Reservation available slots"
        ],
        "operationId": "findReservations",
        "summary": "List reservations",
        "description": "Returns a paginated list of the organization's reservations, with `service`, `contact` and `assigned_resources` joined.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservations/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Reservations"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Reservation available slots"
        ],
        "operationId": "createReservations",
        "summary": "Create a reservation",
        "description": "Books a contact into a service. Pick a slot from [available slots](/docs/api-reference/reservation-available-slots/list) and send its `start_datetime`; the end time is computed from the service duration.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservations/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservations"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/reservations/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Reservation available slots"
        ],
        "operationId": "getReservations",
        "summary": "Get a reservation",
        "description": "Returns one reservation by ID, with `service`, `contact` and `assigned_resources` joined.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservations/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservations"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Reservation available slots"
        ],
        "operationId": "patchReservations",
        "summary": "Update a reservation",
        "description": "Partially updates a reservation: reschedule, change status (confirm, complete, cancel, no-show), notes, links or custom fields. Only the fields you send change.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservations/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservations"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Reservation available slots"
        ],
        "operationId": "removeReservations",
        "summary": "Delete a reservation",
        "description": "Deletes a reservation. This is a soft delete: the record gets `deleted_at` and no longer appears in list or get. To keep the booking in history, [update](/docs/api-reference/reservations/update) its `status` to `cancelled` instead. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/reservations/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservations"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/s3-url-signing": {
      "post": {
        "tags": [
          "Reservation booking links"
        ],
        "operationId": "createS3UrlSigning",
        "summary": "Create an upload URL",
        "description": "Get a pre-signed URL to upload one file. The URL accepts a single `PUT` and expires after 1 hour.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/s3-url-signing/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/S3UrlSigningData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/S3UrlSigning"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support-tickets": {
      "get": {
        "tags": [
          "Support Tickets"
        ],
        "operationId": "findSupportTickets",
        "summary": "List support tickets",
        "description": "List the support tickets of your organization with filters and pagination.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/support-tickets/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SupportTickets"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Support Tickets"
        ],
        "operationId": "createSupportTickets",
        "summary": "Create a support ticket",
        "description": "Create a support ticket in your helpdesk. The organization needs an active helpdesk inbox (Gmail or Outlook): the ticket is attached to it automatically.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/support-tickets/create"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportTicketsData"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTickets"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support-tickets/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "Support Tickets"
        ],
        "operationId": "getSupportTickets",
        "summary": "Get a support ticket",
        "description": "Retrieve one support ticket by ID. The response also includes the ticket's contact.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/support-tickets/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTickets"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Support Tickets"
        ],
        "operationId": "patchSupportTickets",
        "summary": "Update a support ticket",
        "description": "Partially update a support ticket: status, priority, owner, AI assistant, tags, pipeline stage or custom fields. Send only the fields you want to change.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/support-tickets/update"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportTicketsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTickets"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Support Tickets"
        ],
        "operationId": "removeSupportTickets",
        "summary": "Delete a support ticket",
        "description": "Delete a support ticket. This is a soft delete: the ticket gets `deleted_at` and no longer appears in list or get responses. Its data is kept. Soft delete: the record gets deleted_at.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/support-tickets/delete"
        },
        "responses": {
          "200": {
            "description": "The deleted record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTickets"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-channel-message-templates": {
      "get": {
        "tags": [
          "WhatsApp templates"
        ],
        "operationId": "findWhatsappChannelMessageTemplates",
        "summary": "List WhatsApp templates",
        "description": "List the WhatsApp templates of your organization or of one WhatsApp number.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/whatsapp-channel-message-templates/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WhatsappChannelMessageTemplates"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-channel-message-templates/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "WhatsApp templates"
        ],
        "operationId": "getWhatsappChannelMessageTemplates",
        "summary": "Get a WhatsApp template",
        "description": "Retrieve one WhatsApp template by ID, for example to read its `variables_matching` before sending it.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/whatsapp-channel-message-templates/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappChannelMessageTemplates"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-channels": {
      "get": {
        "tags": [
          "WhatsApp numbers"
        ],
        "operationId": "findWhatsappChannels",
        "summary": "List WhatsApp numbers",
        "description": "List the WhatsApp numbers connected to your organization, for example to pick the `whatsapp_channel_id` that [starts a conversation](/docs/api-reference/conversations/initiate-whatsapp).",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/whatsapp-channels/list"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "skip": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WhatsappChannels"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp-channels/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/id"
        }
      ],
      "get": {
        "tags": [
          "WhatsApp numbers"
        ],
        "operationId": "getWhatsappChannels",
        "summary": "Get a WhatsApp number",
        "description": "Retrieve one connected WhatsApp number by ID.",
        "externalDocs": {
          "url": "https://www.achieveapex.com/docs/api-reference/whatsapp-channels/get"
        },
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappChannels"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: invalid body or query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing API key or not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "parameters": {
      "limit": {
        "name": "$limit",
        "in": "query",
        "description": "Page size (default 10, max 50)",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 50
        }
      },
      "skip": {
        "name": "$skip",
        "in": "query",
        "description": "Records to skip",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "sort": {
        "name": "$sort",
        "in": "query",
        "style": "deepObject",
        "explode": true,
        "description": "Sort, e.g. $sort[created_at]=-1",
        "schema": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "enum": [
              1,
              -1
            ]
          }
        }
      },
      "id": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": [
            "integer",
            "string"
          ]
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "code": {
            "type": "integer"
          },
          "className": {
            "type": "string"
          },
          "data": {}
        }
      },
      "Activities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "subject",
          "activity_type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_to_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "subject": {
            "type": "string"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "public_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_geocoded": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "start_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          },
          "end_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"
          },
          "duration": {
            "type": "number"
          },
          "deal_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "activity_type": {
            "type": "string",
            "default": "call"
          },
          "done": {
            "type": "boolean",
            "default": false
          },
          "attendees": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "responseStatus": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "needsAction",
                    "accepted",
                    "declined",
                    "tentative"
                  ]
                }
              },
              "required": [
                "email"
              ]
            }
          },
          "google_meet_link": {
            "type": [
              "string",
              "null"
            ]
          },
          "create_google_meet": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "synced_to_calendar": {
            "type": "boolean",
            "default": false
          },
          "sync_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pending",
              "synced",
              "failed",
              "not_synced"
            ]
          },
          "last_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ActivitiesData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_to_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "subject": {
            "type": "string"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "public_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_geocoded": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "start_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          },
          "end_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"
          },
          "duration": {
            "type": "number"
          },
          "deal_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "activity_type": {
            "type": "string",
            "default": "call"
          },
          "done": {
            "type": "boolean",
            "default": false
          },
          "attendees": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "responseStatus": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "needsAction",
                    "accepted",
                    "declined",
                    "tentative"
                  ]
                }
              },
              "required": [
                "email"
              ]
            }
          },
          "google_meet_link": {
            "type": [
              "string",
              "null"
            ]
          },
          "create_google_meet": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "synced_to_calendar": {
            "type": "boolean",
            "default": false
          },
          "sync_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pending",
              "synced",
              "failed",
              "not_synced"
            ]
          },
          "last_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ActivitiesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_to_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "subject": {
            "type": "string"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "public_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_geocoded": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "start_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          },
          "end_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"
          },
          "duration": {
            "type": "number"
          },
          "deal_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "activity_type": {
            "type": "string",
            "default": "call"
          },
          "done": {
            "type": "boolean",
            "default": false
          },
          "attendees": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "responseStatus": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "needsAction",
                    "accepted",
                    "declined",
                    "tentative"
                  ]
                }
              },
              "required": [
                "email"
              ]
            }
          },
          "google_meet_link": {
            "type": [
              "string",
              "null"
            ]
          },
          "create_google_meet": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "synced_to_calendar": {
            "type": "boolean",
            "default": false
          },
          "sync_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pending",
              "synced",
              "failed",
              "not_synced"
            ]
          },
          "last_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ActivityTypes": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": [
              "string",
              "null"
            ]
          },
          "icon_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ActivityTypesData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": [
              "string",
              "null"
            ]
          },
          "icon_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ActivityTypesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": [
              "string",
              "null"
            ]
          },
          "icon_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AiAssistantSkills": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "assistant_id",
          "name",
          "content",
          "when_to_use"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "assistant_id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "when_to_use": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AiAssistantSkillsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "assistant_id",
          "name",
          "content",
          "when_to_use"
        ],
        "properties": {
          "organization_id": {
            "type": "number"
          },
          "assistant_id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "when_to_use": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AiAssistantSkillsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "organization_id": {
            "type": "number"
          },
          "assistant_id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "when_to_use": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AiAssistants": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "ai_model_id",
          "organization_id",
          "connection"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "assistant_type": {
            "type": "string",
            "enum": [
              "conversation",
              "support-ticket",
              "helpdesk",
              "ai-chat",
              "voice"
            ]
          },
          "ai_model_id": {
            "type": "number"
          },
          "instructions": {
            "type": [
              "string",
              "null"
            ]
          },
          "instructions_language": {
            "type": "string",
            "enum": [
              "ENG",
              "ESP"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "acting_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "connection": {
            "type": "string",
            "enum": [
              "system",
              "organization",
              "specific"
            ]
          },
          "specific_openai_secret_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "version_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "disable_reply": {
            "type": "boolean",
            "default": false
          },
          "analyze_images": {
            "type": "boolean",
            "default": true
          },
          "enable_message_burst_handling": {
            "type": "boolean",
            "default": false
          },
          "can_send_images": {
            "type": "boolean",
            "default": false
          },
          "can_send_audio": {
            "type": "boolean",
            "default": false
          },
          "can_send_video": {
            "type": "boolean",
            "default": false
          },
          "can_send_documents": {
            "type": "boolean",
            "default": false
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "default": "UTC"
          },
          "additional_json_keys": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "object"
                },
                {
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "advanced_options": {
            "type": "object",
            "default": {
              "verbosity": "low",
              "reasoning_effort": "none",
              "tools": {}
            },
            "properties": {
              "verbosity": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "low",
                  "medium",
                  "high"
                ]
              },
              "reasoning_effort": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "none",
                  "minimal",
                  "low",
                  "medium",
                  "high"
                ]
              },
              "tools": {
                "type": "object",
                "properties": {
                  "search_product": {
                    "type": "boolean"
                  },
                  "web_search": {
                    "type": "boolean"
                  },
                  "web_search_config": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "user_location": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "approximate"
                            ],
                            "default": "approximate"
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 2
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "region": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "timezone": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      },
                      "allowed_domains": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 20
                      }
                    }
                  }
                }
              },
              "conversation_summary_config": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "default": false
                  },
                  "instructions": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          },
          "access_permissions_contact": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "read",
              "read_write"
            ],
            "default": "none"
          },
          "access_permissions_deals": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "read",
              "read_write"
            ],
            "default": "none"
          },
          "access_permissions_customer_support": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "read",
              "read_write"
            ],
            "default": "none"
          },
          "access_permissions_automations": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "automation_id": {
                  "type": "number"
                },
                "when_to_use": {
                  "type": "string"
                }
              },
              "required": [
                "automation_id",
                "when_to_use"
              ]
            }
          },
          "human_handoff_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "name",
                    "instructions",
                    "team_members"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "instructions": {
                      "type": "string"
                    },
                    "team_members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "user_id",
                          "weight"
                        ],
                        "properties": {
                          "user_id": {
                            "type": "number"
                          },
                          "weight": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100
                          }
                        }
                      }
                    },
                    "handoff_message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "keep_assigned_team_member": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "assign_to_contact_owner": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "unassign_ai_agent": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "mark_conversation_unread": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "pipeline_id": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "stage_id": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "respect_advisor_availability": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "availability_fallback": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "unassigned",
                            "keep_ai",
                            "fallback_user",
                            "contact_owner"
                          ]
                        },
                        "user_id": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "external_handoff_targets": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "instructions",
                    "label",
                    "destination_type"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "instructions": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "destination_type": {
                      "type": "string",
                      "enum": [
                        "external_number",
                        "sip_uri"
                      ]
                    },
                    "phone_number": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sip_uri": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country_code": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "minLength": 2,
                      "maxLength": 2
                    },
                    "handoff_message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timeout_secs": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 5,
                      "maximum": 120
                    },
                    "enabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "ai_assistant_handoff_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "name",
                    "instructions",
                    "ai_assistant_id"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "instructions": {
                      "type": "string"
                    },
                    "ai_assistant_id": {
                      "type": "number"
                    },
                    "handoff_message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "keep_assigned_human": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "mark_conversation_unread": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "ai_safeguards": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": false,
            "properties": {
              "max_executions_per_hour": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 20,
                "maximum": 200
              },
              "max_executions_per_day": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 50,
                "maximum": 1000
              },
              "max_responses_per_minute": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 2,
                "maximum": 30
              },
              "min_response_time_seconds": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "maximum": 10
              },
              "max_tokens_per_minute": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 50000,
                "maximum": 2000000
              },
              "anomaly_detection_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "lookback_minutes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 5,
                "maximum": 60
              },
              "min_total_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 10,
                "maximum": 300
              },
              "min_ai_outgoing_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 5,
                "maximum": 150
              },
              "min_active_minutes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "maximum": 60
              },
              "min_alternation_ratio": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0.3,
                "maximum": 1
              },
              "alternation_burst_window_ms": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 10000
              },
              "max_human_agent_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 50
              },
              "min_repeated_incoming_text_count": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 100
              },
              "strong_repeated_incoming_text_count": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 200
              },
              "min_unsupported_incoming_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 100
              },
              "require_secondary_signal": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "ignored_repeated_incoming_texts": {
                "type": [
                  "array",
                  "null"
                ],
                "maxItems": 50,
                "items": {
                  "type": "string",
                  "maxLength": 60
                }
              }
            }
          },
          "follow_up_config": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": false
              },
              "follow_up_limit": {
                "type": "number",
                "default": 3
              },
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "when_to_assign",
                    "follow_up_actions"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "when_to_assign": {
                      "type": "string"
                    },
                    "time_after": {
                      "type": "number",
                      "default": 0
                    },
                    "follow_up_actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "template",
                              "automation",
                              "ai_generated_message"
                            ]
                          },
                          "template": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "required": [
                              "type",
                              "template_id"
                            ],
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "email",
                                  "whatsapp",
                                  "predefined_message"
                                ]
                              },
                              "template_id": {
                                "type": "number"
                              }
                            }
                          },
                          "automation_id": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "instruction": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "api_tools": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "required": [
                "api_tool_id"
              ],
              "properties": {
                "api_tool_id": {
                  "type": "number"
                },
                "description": {
                  "type": "string"
                },
                "when_to_use": {
                  "type": "string"
                },
                "config": {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              }
            }
          },
          "internal_tools": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": false
              },
              "tools": {
                "type": "object",
                "properties": {
                  "create_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "set_contact_dnd": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_deal": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_deals": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_deal": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_deal": {
                    "type": "boolean",
                    "default": false
                  },
                  "add_deal_products": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_helpdesk_ticket": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_helpdesk_ticket": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_helpdesk_tickets": {
                    "type": "boolean",
                    "default": false
                  },
                  "search_helpdesk_knowledge": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_conversations": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_conversation": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_conversation": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_conversation_messages": {
                    "type": "boolean",
                    "default": false
                  },
                  "search_conversation_messages": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_product": {
                    "type": "boolean",
                    "default": false
                  },
                  "add_note": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_note": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_activity": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_activity": {
                    "type": "boolean",
                    "default": false
                  },
                  "delete_activity": {
                    "type": "boolean",
                    "default": false
                  },
                  "initiate_whatsapp_conversation": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_whatsapp_template": {
                    "type": "boolean",
                    "default": false
                  },
                  "send_whatsapp_template": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_pipelines": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_currencies": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_custom_fields": {
                    "type": "boolean",
                    "default": false
                  },
                  "search_products": {
                    "type": "boolean",
                    "default": false
                  },
                  "send_conversation_message": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_smart_link": {
                    "type": "boolean",
                    "default": false
                  },
                  "list_loyalty_programs": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_loyalty_card": {
                    "type": "boolean",
                    "default": false
                  },
                  "enroll_loyalty_member": {
                    "type": "boolean",
                    "default": false
                  },
                  "redeem_loyalty_reward": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_email_broadcast_senders": {
                    "type": "boolean",
                    "default": false
                  },
                  "send_email_broadcast": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_estimate_pdf": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_invoice_pdf": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_finance_plans": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_finance_plan": {
                    "type": "boolean",
                    "default": false
                  },
                  "calculate_finance_scenario": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_finance_plan": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_finance_plan": {
                    "type": "boolean",
                    "default": false
                  },
                  "save_finance_plan_version": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_orders": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "add_order_item": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_order_item": {
                    "type": "boolean",
                    "default": false
                  },
                  "delete_order_item": {
                    "type": "boolean",
                    "default": false
                  },
                  "cancel_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_order_payment_link": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_order_fulfillment": {
                    "type": "boolean",
                    "default": false
                  },
                  "convert_estimate_to_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "convert_order_to_invoice": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_checkout_link": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_organization_ai_voices": {
                    "type": "boolean",
                    "default": false
                  },
                  "synthesize_ai_voice": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_automations": {
                    "type": "boolean",
                    "default": false
                  },
                  "execute_automation": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_reservations": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_reservation": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_reservation": {
                    "type": "boolean",
                    "default": false
                  },
                  "delete_reservation": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_reservation_services": {
                    "type": "boolean",
                    "default": false
                  },
                  "track_conversation_event": {
                    "type": "boolean",
                    "default": false
                  }
                }
              },
              "track_conversation_event_config": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "event_definition_ids": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "maxItems": 50
                  }
                }
              }
            }
          },
          "response_config": {
            "type": [
              "object",
              "null"
            ],
            "default": {
              "response_mode": "single",
              "max_messages_per_response": 1,
              "delay_between_messages_ms": 1000
            },
            "properties": {
              "response_mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "single",
                  "multi"
                ],
                "default": "single"
              },
              "max_messages_per_response": {
                "type": [
                  "number",
                  "null"
                ],
                "default": 1,
                "minimum": 1,
                "maximum": 10
              },
              "delay_between_messages_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "default": 1000,
                "minimum": 500,
                "maximum": 5000
              },
              "allow_no_reply": {
                "type": [
                  "boolean",
                  "null"
                ],
                "default": false
              },
              "no_reply_instructions": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "agent_loop_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "max_iterations": {
                "type": "number",
                "default": 100
              },
              "enable_clarification": {
                "type": "boolean",
                "default": true
              }
            }
          },
          "schedule_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "always_on": {
                "type": "boolean",
                "default": true
              },
              "out_of_schedule_action": {
                "type": "string",
                "enum": [
                  "message",
                  "handoff"
                ],
                "default": "message"
              },
              "schedule_not_available_message": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "schedule_handoff_config": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "handoff_message": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "unassign_ai_agent": {
                    "type": "boolean",
                    "default": true
                  },
                  "mark_conversation_unread": {
                    "type": "boolean",
                    "default": true
                  },
                  "respect_advisor_availability": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "availability_fallback": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "unassigned",
                          "keep_ai",
                          "fallback_user",
                          "contact_owner"
                        ]
                      },
                      "user_id": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    }
                  },
                  "team_members": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "user_id": {
                          "type": "number"
                        },
                        "weight": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 100
                        }
                      }
                    }
                  },
                  "per_day_distribution": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "monday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "tuesday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "wednesday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "thursday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "friday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "saturday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "sunday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      }
                    }
                  }
                }
              },
              "weekly_schedule": {
                "type": "object",
                "properties": {
                  "monday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "tuesday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "wednesday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "thursday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "friday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "saturday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "sunday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "mcp_tools": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "required": [
                "url",
                "label",
                "authentication_type"
              ],
              "properties": {
                "url": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "authentication_type": {
                  "type": "string",
                  "enum": [
                    "none",
                    "api_key",
                    "custom_headers",
                    "oauth2"
                  ]
                },
                "api_key": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "custom_headers": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "key",
                      "value"
                    ],
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    }
                  }
                },
                "oauth2_config": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "authorization_server_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "client_secret": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "access_token": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "refresh_token": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "token_expiry": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "resource_uri": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scopes": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "enabled_tools": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "tools": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "inputSchema": {
                        "type": [
                          "object",
                          "null"
                        ]
                      }
                    }
                  }
                },
                "needs_reauthorization": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              }
            }
          },
          "is_easy_mode": {
            "type": "boolean",
            "default": true
          },
          "easy_mode_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "brand": {
                "type": "string"
              },
              "assistantName": {
                "type": "string"
              },
              "role": {
                "type": "string"
              },
              "objectives": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "restrictions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "additionalInstructions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "products": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "promotions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "conversationFlows": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "companyLocations": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "dialectSections": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "dynamicSections": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "voice_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "default": false
          },
          "telnyx_ai_assistant_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "telnyx_assistant_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_runtime": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "telnyx_builtin",
                  "custom_llm",
                  "openai_realtime_sip"
                ]
              },
              "voice_provider": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[a-z0-9_-]+$"
              },
              "voice_provider_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "unified",
                  "distinct"
                ]
              },
              "sync_status": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "synced",
                  "pending",
                  "error"
                ]
              },
              "last_synced_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "enabled_tools": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "webhook_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "use_custom_llm": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "custom_llm_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "openai_realtime_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "openai_realtime_voice": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "openai_realtime_sip_uri": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "greeting": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_speed": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "voice_language_boost": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_expressive_mode": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "voice_similarity_boost": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "voice_style": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "voice_use_speaker_boost": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "background_audio": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "predefined_media",
                      "media_url",
                      "media_name"
                    ]
                  },
                  "value": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "transcription_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transcription_language": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transcription_region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transcription_settings": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "eot_threshold": {
                    "type": "number",
                    "minimum": 0.5,
                    "maximum": 0.9
                  },
                  "eot_timeout_ms": {
                    "type": "integer",
                    "minimum": 500,
                    "maximum": 10000
                  },
                  "eager_eot_threshold": {
                    "type": "number",
                    "minimum": 0.3,
                    "maximum": 0.9
                  },
                  "keyterm": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "context": {
                    "type": "string",
                    "maxLength": 10000
                  }
                }
              },
              "interruption_enable": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "speaking_wait_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "speaking_on_punctuation_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "speaking_on_no_punctuation_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "speaking_on_number_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "supports_unauthenticated_web_calls": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "delivery_status_webhook_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "enabled_features": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "data_retention": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "dynamic_variables_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "dynamic_variables_defaults": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "dynamic_variables_automation_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "dynamic_variables_webhook_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "dynamic_variables_webhook_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "widget_settings": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "voice_api_key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_api_key_ref": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transfer_from_number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "external_transfer_caller_id_mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "company_number",
                  "original_caller"
                ]
              },
              "elevenlabs_agent_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "imported_from": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "telnyx_tools": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "object"
                }
              },
              "knowledge_bucket_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "knowledge_document_key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "knowledge_embedding_task_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "knowledge_last_synced_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "knowledge_content_hash": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "hangup_tool_description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "post_conversation_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "post_conversation_instructions": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "error_message": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "debug_webhook_base_url": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "AiAssistantsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "ai_model_id",
          "organization_id",
          "connection"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "assistant_type": {
            "type": "string",
            "enum": [
              "conversation",
              "support-ticket",
              "helpdesk",
              "ai-chat",
              "voice"
            ]
          },
          "ai_model_id": {
            "type": "number"
          },
          "instructions": {
            "type": [
              "string",
              "null"
            ]
          },
          "instructions_language": {
            "type": "string",
            "enum": [
              "ENG",
              "ESP"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "acting_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "connection": {
            "type": "string",
            "enum": [
              "system",
              "organization",
              "specific"
            ]
          },
          "specific_openai_secret_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "version_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "disable_reply": {
            "type": "boolean",
            "default": false
          },
          "analyze_images": {
            "type": "boolean",
            "default": true
          },
          "enable_message_burst_handling": {
            "type": "boolean",
            "default": false
          },
          "can_send_images": {
            "type": "boolean",
            "default": false
          },
          "can_send_audio": {
            "type": "boolean",
            "default": false
          },
          "can_send_video": {
            "type": "boolean",
            "default": false
          },
          "can_send_documents": {
            "type": "boolean",
            "default": false
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "default": "UTC"
          },
          "additional_json_keys": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "object"
                },
                {
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "advanced_options": {
            "type": "object",
            "default": {
              "verbosity": "low",
              "reasoning_effort": "none",
              "tools": {}
            },
            "properties": {
              "verbosity": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "low",
                  "medium",
                  "high"
                ]
              },
              "reasoning_effort": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "none",
                  "minimal",
                  "low",
                  "medium",
                  "high"
                ]
              },
              "tools": {
                "type": "object",
                "properties": {
                  "search_product": {
                    "type": "boolean"
                  },
                  "web_search": {
                    "type": "boolean"
                  },
                  "web_search_config": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "user_location": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "approximate"
                            ],
                            "default": "approximate"
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 2
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "region": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "timezone": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      },
                      "allowed_domains": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 20
                      }
                    }
                  }
                }
              },
              "conversation_summary_config": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "default": false
                  },
                  "instructions": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          },
          "access_permissions_contact": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "read",
              "read_write"
            ],
            "default": "none"
          },
          "access_permissions_deals": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "read",
              "read_write"
            ],
            "default": "none"
          },
          "access_permissions_customer_support": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "read",
              "read_write"
            ],
            "default": "none"
          },
          "access_permissions_automations": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "automation_id": {
                  "type": "number"
                },
                "when_to_use": {
                  "type": "string"
                }
              },
              "required": [
                "automation_id",
                "when_to_use"
              ]
            }
          },
          "human_handoff_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "name",
                    "instructions",
                    "team_members"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "instructions": {
                      "type": "string"
                    },
                    "team_members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "user_id",
                          "weight"
                        ],
                        "properties": {
                          "user_id": {
                            "type": "number"
                          },
                          "weight": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100
                          }
                        }
                      }
                    },
                    "handoff_message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "keep_assigned_team_member": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "assign_to_contact_owner": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "unassign_ai_agent": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "mark_conversation_unread": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "pipeline_id": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "stage_id": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "respect_advisor_availability": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "availability_fallback": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "unassigned",
                            "keep_ai",
                            "fallback_user",
                            "contact_owner"
                          ]
                        },
                        "user_id": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "external_handoff_targets": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "instructions",
                    "label",
                    "destination_type"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "instructions": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "destination_type": {
                      "type": "string",
                      "enum": [
                        "external_number",
                        "sip_uri"
                      ]
                    },
                    "phone_number": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sip_uri": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country_code": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "minLength": 2,
                      "maxLength": 2
                    },
                    "handoff_message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timeout_secs": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 5,
                      "maximum": 120
                    },
                    "enabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "ai_assistant_handoff_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "name",
                    "instructions",
                    "ai_assistant_id"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "instructions": {
                      "type": "string"
                    },
                    "ai_assistant_id": {
                      "type": "number"
                    },
                    "handoff_message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "keep_assigned_human": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "mark_conversation_unread": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "ai_safeguards": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": false,
            "properties": {
              "max_executions_per_hour": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 20,
                "maximum": 200
              },
              "max_executions_per_day": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 50,
                "maximum": 1000
              },
              "max_responses_per_minute": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 2,
                "maximum": 30
              },
              "min_response_time_seconds": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "maximum": 10
              },
              "max_tokens_per_minute": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 50000,
                "maximum": 2000000
              },
              "anomaly_detection_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "lookback_minutes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 5,
                "maximum": 60
              },
              "min_total_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 10,
                "maximum": 300
              },
              "min_ai_outgoing_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 5,
                "maximum": 150
              },
              "min_active_minutes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "maximum": 60
              },
              "min_alternation_ratio": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0.3,
                "maximum": 1
              },
              "alternation_burst_window_ms": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 10000
              },
              "max_human_agent_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 50
              },
              "min_repeated_incoming_text_count": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 100
              },
              "strong_repeated_incoming_text_count": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 200
              },
              "min_unsupported_incoming_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 100
              },
              "require_secondary_signal": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "ignored_repeated_incoming_texts": {
                "type": [
                  "array",
                  "null"
                ],
                "maxItems": 50,
                "items": {
                  "type": "string",
                  "maxLength": 60
                }
              }
            }
          },
          "follow_up_config": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": false
              },
              "follow_up_limit": {
                "type": "number",
                "default": 3
              },
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "when_to_assign",
                    "follow_up_actions"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "when_to_assign": {
                      "type": "string"
                    },
                    "time_after": {
                      "type": "number",
                      "default": 0
                    },
                    "follow_up_actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "template",
                              "automation",
                              "ai_generated_message"
                            ]
                          },
                          "template": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "required": [
                              "type",
                              "template_id"
                            ],
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "email",
                                  "whatsapp",
                                  "predefined_message"
                                ]
                              },
                              "template_id": {
                                "type": "number"
                              }
                            }
                          },
                          "automation_id": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "instruction": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "api_tools": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "required": [
                "api_tool_id"
              ],
              "properties": {
                "api_tool_id": {
                  "type": "number"
                },
                "description": {
                  "type": "string"
                },
                "when_to_use": {
                  "type": "string"
                },
                "config": {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              }
            }
          },
          "internal_tools": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": false
              },
              "tools": {
                "type": "object",
                "properties": {
                  "create_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "set_contact_dnd": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_deal": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_deals": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_deal": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_deal": {
                    "type": "boolean",
                    "default": false
                  },
                  "add_deal_products": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_helpdesk_ticket": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_helpdesk_ticket": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_helpdesk_tickets": {
                    "type": "boolean",
                    "default": false
                  },
                  "search_helpdesk_knowledge": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_conversations": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_conversation": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_conversation": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_conversation_messages": {
                    "type": "boolean",
                    "default": false
                  },
                  "search_conversation_messages": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_product": {
                    "type": "boolean",
                    "default": false
                  },
                  "add_note": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_note": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_activity": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_activity": {
                    "type": "boolean",
                    "default": false
                  },
                  "delete_activity": {
                    "type": "boolean",
                    "default": false
                  },
                  "initiate_whatsapp_conversation": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_whatsapp_template": {
                    "type": "boolean",
                    "default": false
                  },
                  "send_whatsapp_template": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_pipelines": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_currencies": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_custom_fields": {
                    "type": "boolean",
                    "default": false
                  },
                  "search_products": {
                    "type": "boolean",
                    "default": false
                  },
                  "send_conversation_message": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_smart_link": {
                    "type": "boolean",
                    "default": false
                  },
                  "list_loyalty_programs": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_loyalty_card": {
                    "type": "boolean",
                    "default": false
                  },
                  "enroll_loyalty_member": {
                    "type": "boolean",
                    "default": false
                  },
                  "redeem_loyalty_reward": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_email_broadcast_senders": {
                    "type": "boolean",
                    "default": false
                  },
                  "send_email_broadcast": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_estimate_pdf": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_invoice_pdf": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_finance_plans": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_finance_plan": {
                    "type": "boolean",
                    "default": false
                  },
                  "calculate_finance_scenario": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_finance_plan": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_finance_plan": {
                    "type": "boolean",
                    "default": false
                  },
                  "save_finance_plan_version": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_orders": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "add_order_item": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_order_item": {
                    "type": "boolean",
                    "default": false
                  },
                  "delete_order_item": {
                    "type": "boolean",
                    "default": false
                  },
                  "cancel_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_order_payment_link": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_order_fulfillment": {
                    "type": "boolean",
                    "default": false
                  },
                  "convert_estimate_to_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "convert_order_to_invoice": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_checkout_link": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_organization_ai_voices": {
                    "type": "boolean",
                    "default": false
                  },
                  "synthesize_ai_voice": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_automations": {
                    "type": "boolean",
                    "default": false
                  },
                  "execute_automation": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_reservations": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_reservation": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_reservation": {
                    "type": "boolean",
                    "default": false
                  },
                  "delete_reservation": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_reservation_services": {
                    "type": "boolean",
                    "default": false
                  },
                  "track_conversation_event": {
                    "type": "boolean",
                    "default": false
                  }
                }
              },
              "track_conversation_event_config": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "event_definition_ids": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "maxItems": 50
                  }
                }
              }
            }
          },
          "response_config": {
            "type": [
              "object",
              "null"
            ],
            "default": {
              "response_mode": "single",
              "max_messages_per_response": 1,
              "delay_between_messages_ms": 1000
            },
            "properties": {
              "response_mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "single",
                  "multi"
                ],
                "default": "single"
              },
              "max_messages_per_response": {
                "type": [
                  "number",
                  "null"
                ],
                "default": 1,
                "minimum": 1,
                "maximum": 10
              },
              "delay_between_messages_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "default": 1000,
                "minimum": 500,
                "maximum": 5000
              },
              "allow_no_reply": {
                "type": [
                  "boolean",
                  "null"
                ],
                "default": false
              },
              "no_reply_instructions": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "agent_loop_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "max_iterations": {
                "type": "number",
                "default": 100
              },
              "enable_clarification": {
                "type": "boolean",
                "default": true
              }
            }
          },
          "schedule_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "always_on": {
                "type": "boolean",
                "default": true
              },
              "out_of_schedule_action": {
                "type": "string",
                "enum": [
                  "message",
                  "handoff"
                ],
                "default": "message"
              },
              "schedule_not_available_message": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "schedule_handoff_config": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "handoff_message": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "unassign_ai_agent": {
                    "type": "boolean",
                    "default": true
                  },
                  "mark_conversation_unread": {
                    "type": "boolean",
                    "default": true
                  },
                  "respect_advisor_availability": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "availability_fallback": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "unassigned",
                          "keep_ai",
                          "fallback_user",
                          "contact_owner"
                        ]
                      },
                      "user_id": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    }
                  },
                  "team_members": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "user_id": {
                          "type": "number"
                        },
                        "weight": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 100
                        }
                      }
                    }
                  },
                  "per_day_distribution": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "monday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "tuesday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "wednesday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "thursday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "friday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "saturday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "sunday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      }
                    }
                  }
                }
              },
              "weekly_schedule": {
                "type": "object",
                "properties": {
                  "monday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "tuesday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "wednesday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "thursday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "friday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "saturday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "sunday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "mcp_tools": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "required": [
                "url",
                "label",
                "authentication_type"
              ],
              "properties": {
                "url": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "authentication_type": {
                  "type": "string",
                  "enum": [
                    "none",
                    "api_key",
                    "custom_headers",
                    "oauth2"
                  ]
                },
                "api_key": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "custom_headers": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "key",
                      "value"
                    ],
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    }
                  }
                },
                "oauth2_config": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "authorization_server_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "client_secret": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "access_token": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "refresh_token": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "token_expiry": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "resource_uri": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scopes": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "enabled_tools": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "tools": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "inputSchema": {
                        "type": [
                          "object",
                          "null"
                        ]
                      }
                    }
                  }
                },
                "needs_reauthorization": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              }
            }
          },
          "is_easy_mode": {
            "type": "boolean",
            "default": true
          },
          "easy_mode_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "brand": {
                "type": "string"
              },
              "assistantName": {
                "type": "string"
              },
              "role": {
                "type": "string"
              },
              "objectives": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "restrictions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "additionalInstructions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "products": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "promotions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "conversationFlows": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "companyLocations": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "dialectSections": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "dynamicSections": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "voice_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "default": false
          },
          "telnyx_ai_assistant_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "telnyx_assistant_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_runtime": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "telnyx_builtin",
                  "custom_llm",
                  "openai_realtime_sip"
                ]
              },
              "voice_provider": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[a-z0-9_-]+$"
              },
              "voice_provider_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "unified",
                  "distinct"
                ]
              },
              "sync_status": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "synced",
                  "pending",
                  "error"
                ]
              },
              "last_synced_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "enabled_tools": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "webhook_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "use_custom_llm": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "custom_llm_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "openai_realtime_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "openai_realtime_voice": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "openai_realtime_sip_uri": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "greeting": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_speed": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "voice_language_boost": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_expressive_mode": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "voice_similarity_boost": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "voice_style": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "voice_use_speaker_boost": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "background_audio": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "predefined_media",
                      "media_url",
                      "media_name"
                    ]
                  },
                  "value": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "transcription_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transcription_language": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transcription_region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transcription_settings": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "eot_threshold": {
                    "type": "number",
                    "minimum": 0.5,
                    "maximum": 0.9
                  },
                  "eot_timeout_ms": {
                    "type": "integer",
                    "minimum": 500,
                    "maximum": 10000
                  },
                  "eager_eot_threshold": {
                    "type": "number",
                    "minimum": 0.3,
                    "maximum": 0.9
                  },
                  "keyterm": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "context": {
                    "type": "string",
                    "maxLength": 10000
                  }
                }
              },
              "interruption_enable": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "speaking_wait_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "speaking_on_punctuation_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "speaking_on_no_punctuation_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "speaking_on_number_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "supports_unauthenticated_web_calls": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "delivery_status_webhook_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "enabled_features": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "data_retention": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "dynamic_variables_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "dynamic_variables_defaults": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "dynamic_variables_automation_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "dynamic_variables_webhook_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "dynamic_variables_webhook_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "widget_settings": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "voice_api_key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_api_key_ref": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transfer_from_number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "external_transfer_caller_id_mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "company_number",
                  "original_caller"
                ]
              },
              "elevenlabs_agent_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "imported_from": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "telnyx_tools": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "object"
                }
              },
              "knowledge_bucket_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "knowledge_document_key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "knowledge_embedding_task_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "knowledge_last_synced_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "knowledge_content_hash": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "hangup_tool_description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "post_conversation_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "post_conversation_instructions": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "error_message": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "debug_webhook_base_url": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "AiAssistantsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "assistant_type": {
            "type": "string",
            "enum": [
              "conversation",
              "support-ticket",
              "helpdesk",
              "ai-chat",
              "voice"
            ]
          },
          "ai_model_id": {
            "type": "number"
          },
          "instructions": {
            "type": [
              "string",
              "null"
            ]
          },
          "instructions_language": {
            "type": "string",
            "enum": [
              "ENG",
              "ESP"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "acting_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "connection": {
            "type": "string",
            "enum": [
              "system",
              "organization",
              "specific"
            ]
          },
          "specific_openai_secret_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "version_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "disable_reply": {
            "type": "boolean",
            "default": false
          },
          "analyze_images": {
            "type": "boolean",
            "default": true
          },
          "enable_message_burst_handling": {
            "type": "boolean",
            "default": false
          },
          "can_send_images": {
            "type": "boolean",
            "default": false
          },
          "can_send_audio": {
            "type": "boolean",
            "default": false
          },
          "can_send_video": {
            "type": "boolean",
            "default": false
          },
          "can_send_documents": {
            "type": "boolean",
            "default": false
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "default": "UTC"
          },
          "additional_json_keys": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "object"
                },
                {
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "advanced_options": {
            "type": "object",
            "default": {
              "verbosity": "low",
              "reasoning_effort": "none",
              "tools": {}
            },
            "properties": {
              "verbosity": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "low",
                  "medium",
                  "high"
                ]
              },
              "reasoning_effort": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "none",
                  "minimal",
                  "low",
                  "medium",
                  "high"
                ]
              },
              "tools": {
                "type": "object",
                "properties": {
                  "search_product": {
                    "type": "boolean"
                  },
                  "web_search": {
                    "type": "boolean"
                  },
                  "web_search_config": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "user_location": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "approximate"
                            ],
                            "default": "approximate"
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 2
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "region": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "timezone": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      },
                      "allowed_domains": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 20
                      }
                    }
                  }
                }
              },
              "conversation_summary_config": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "default": false
                  },
                  "instructions": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          },
          "access_permissions_contact": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "read",
              "read_write"
            ],
            "default": "none"
          },
          "access_permissions_deals": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "read",
              "read_write"
            ],
            "default": "none"
          },
          "access_permissions_customer_support": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "read",
              "read_write"
            ],
            "default": "none"
          },
          "access_permissions_automations": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "automation_id": {
                  "type": "number"
                },
                "when_to_use": {
                  "type": "string"
                }
              },
              "required": [
                "automation_id",
                "when_to_use"
              ]
            }
          },
          "human_handoff_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "name",
                    "instructions",
                    "team_members"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "instructions": {
                      "type": "string"
                    },
                    "team_members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "user_id",
                          "weight"
                        ],
                        "properties": {
                          "user_id": {
                            "type": "number"
                          },
                          "weight": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100
                          }
                        }
                      }
                    },
                    "handoff_message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "keep_assigned_team_member": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "assign_to_contact_owner": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "unassign_ai_agent": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "mark_conversation_unread": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "pipeline_id": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "stage_id": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "respect_advisor_availability": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "availability_fallback": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "unassigned",
                            "keep_ai",
                            "fallback_user",
                            "contact_owner"
                          ]
                        },
                        "user_id": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "external_handoff_targets": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "instructions",
                    "label",
                    "destination_type"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "instructions": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "destination_type": {
                      "type": "string",
                      "enum": [
                        "external_number",
                        "sip_uri"
                      ]
                    },
                    "phone_number": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sip_uri": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country_code": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "minLength": 2,
                      "maxLength": 2
                    },
                    "handoff_message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timeout_secs": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 5,
                      "maximum": 120
                    },
                    "enabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "ai_assistant_handoff_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "name",
                    "instructions",
                    "ai_assistant_id"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "instructions": {
                      "type": "string"
                    },
                    "ai_assistant_id": {
                      "type": "number"
                    },
                    "handoff_message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "keep_assigned_human": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "mark_conversation_unread": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "ai_safeguards": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": false,
            "properties": {
              "max_executions_per_hour": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 20,
                "maximum": 200
              },
              "max_executions_per_day": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 50,
                "maximum": 1000
              },
              "max_responses_per_minute": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 2,
                "maximum": 30
              },
              "min_response_time_seconds": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "maximum": 10
              },
              "max_tokens_per_minute": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 50000,
                "maximum": 2000000
              },
              "anomaly_detection_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "lookback_minutes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 5,
                "maximum": 60
              },
              "min_total_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 10,
                "maximum": 300
              },
              "min_ai_outgoing_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 5,
                "maximum": 150
              },
              "min_active_minutes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "maximum": 60
              },
              "min_alternation_ratio": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0.3,
                "maximum": 1
              },
              "alternation_burst_window_ms": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 10000
              },
              "max_human_agent_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 50
              },
              "min_repeated_incoming_text_count": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 100
              },
              "strong_repeated_incoming_text_count": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 200
              },
              "min_unsupported_incoming_messages": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 100
              },
              "require_secondary_signal": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "ignored_repeated_incoming_texts": {
                "type": [
                  "array",
                  "null"
                ],
                "maxItems": 50,
                "items": {
                  "type": "string",
                  "maxLength": 60
                }
              }
            }
          },
          "follow_up_config": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": false
              },
              "follow_up_limit": {
                "type": "number",
                "default": 3
              },
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "when_to_assign",
                    "follow_up_actions"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "when_to_assign": {
                      "type": "string"
                    },
                    "time_after": {
                      "type": "number",
                      "default": 0
                    },
                    "follow_up_actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "template",
                              "automation",
                              "ai_generated_message"
                            ]
                          },
                          "template": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "required": [
                              "type",
                              "template_id"
                            ],
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "email",
                                  "whatsapp",
                                  "predefined_message"
                                ]
                              },
                              "template_id": {
                                "type": "number"
                              }
                            }
                          },
                          "automation_id": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "instruction": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "api_tools": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "required": [
                "api_tool_id"
              ],
              "properties": {
                "api_tool_id": {
                  "type": "number"
                },
                "description": {
                  "type": "string"
                },
                "when_to_use": {
                  "type": "string"
                },
                "config": {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              }
            }
          },
          "internal_tools": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "enabled": {
                "type": "boolean",
                "default": false
              },
              "tools": {
                "type": "object",
                "properties": {
                  "create_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_contact": {
                    "type": "boolean",
                    "default": false
                  },
                  "set_contact_dnd": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_deal": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_deals": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_deal": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_deal": {
                    "type": "boolean",
                    "default": false
                  },
                  "add_deal_products": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_helpdesk_ticket": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_helpdesk_ticket": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_helpdesk_tickets": {
                    "type": "boolean",
                    "default": false
                  },
                  "search_helpdesk_knowledge": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_company": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_conversations": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_conversation": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_conversation": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_conversation_messages": {
                    "type": "boolean",
                    "default": false
                  },
                  "search_conversation_messages": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_product": {
                    "type": "boolean",
                    "default": false
                  },
                  "add_note": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_note": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_activity": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_activity": {
                    "type": "boolean",
                    "default": false
                  },
                  "delete_activity": {
                    "type": "boolean",
                    "default": false
                  },
                  "initiate_whatsapp_conversation": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_whatsapp_template": {
                    "type": "boolean",
                    "default": false
                  },
                  "send_whatsapp_template": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_pipelines": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_currencies": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_custom_fields": {
                    "type": "boolean",
                    "default": false
                  },
                  "search_products": {
                    "type": "boolean",
                    "default": false
                  },
                  "send_conversation_message": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_smart_link": {
                    "type": "boolean",
                    "default": false
                  },
                  "list_loyalty_programs": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_loyalty_card": {
                    "type": "boolean",
                    "default": false
                  },
                  "enroll_loyalty_member": {
                    "type": "boolean",
                    "default": false
                  },
                  "redeem_loyalty_reward": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_email_broadcast_senders": {
                    "type": "boolean",
                    "default": false
                  },
                  "send_email_broadcast": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_estimate_pdf": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_invoice_pdf": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_finance_plans": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_finance_plan": {
                    "type": "boolean",
                    "default": false
                  },
                  "calculate_finance_scenario": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_finance_plan": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_finance_plan": {
                    "type": "boolean",
                    "default": false
                  },
                  "save_finance_plan_version": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_orders": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "add_order_item": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_order_item": {
                    "type": "boolean",
                    "default": false
                  },
                  "delete_order_item": {
                    "type": "boolean",
                    "default": false
                  },
                  "cancel_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_order_payment_link": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_order_fulfillment": {
                    "type": "boolean",
                    "default": false
                  },
                  "convert_estimate_to_order": {
                    "type": "boolean",
                    "default": false
                  },
                  "convert_order_to_invoice": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_checkout_link": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_organization_ai_voices": {
                    "type": "boolean",
                    "default": false
                  },
                  "synthesize_ai_voice": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_automations": {
                    "type": "boolean",
                    "default": false
                  },
                  "execute_automation": {
                    "type": "boolean",
                    "default": false
                  },
                  "find_reservations": {
                    "type": "boolean",
                    "default": false
                  },
                  "create_reservation": {
                    "type": "boolean",
                    "default": false
                  },
                  "update_reservation": {
                    "type": "boolean",
                    "default": false
                  },
                  "delete_reservation": {
                    "type": "boolean",
                    "default": false
                  },
                  "get_reservation_services": {
                    "type": "boolean",
                    "default": false
                  },
                  "track_conversation_event": {
                    "type": "boolean",
                    "default": false
                  }
                }
              },
              "track_conversation_event_config": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "event_definition_ids": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "maxItems": 50
                  }
                }
              }
            }
          },
          "response_config": {
            "type": [
              "object",
              "null"
            ],
            "default": {
              "response_mode": "single",
              "max_messages_per_response": 1,
              "delay_between_messages_ms": 1000
            },
            "properties": {
              "response_mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "single",
                  "multi"
                ],
                "default": "single"
              },
              "max_messages_per_response": {
                "type": [
                  "number",
                  "null"
                ],
                "default": 1,
                "minimum": 1,
                "maximum": 10
              },
              "delay_between_messages_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "default": 1000,
                "minimum": 500,
                "maximum": 5000
              },
              "allow_no_reply": {
                "type": [
                  "boolean",
                  "null"
                ],
                "default": false
              },
              "no_reply_instructions": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "agent_loop_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "max_iterations": {
                "type": "number",
                "default": 100
              },
              "enable_clarification": {
                "type": "boolean",
                "default": true
              }
            }
          },
          "schedule_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "always_on": {
                "type": "boolean",
                "default": true
              },
              "out_of_schedule_action": {
                "type": "string",
                "enum": [
                  "message",
                  "handoff"
                ],
                "default": "message"
              },
              "schedule_not_available_message": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "schedule_handoff_config": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "handoff_message": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "unassign_ai_agent": {
                    "type": "boolean",
                    "default": true
                  },
                  "mark_conversation_unread": {
                    "type": "boolean",
                    "default": true
                  },
                  "respect_advisor_availability": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "availability_fallback": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "unassigned",
                          "keep_ai",
                          "fallback_user",
                          "contact_owner"
                        ]
                      },
                      "user_id": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    }
                  },
                  "team_members": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "user_id": {
                          "type": "number"
                        },
                        "weight": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 100
                        }
                      }
                    }
                  },
                  "per_day_distribution": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "monday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "tuesday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "wednesday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "thursday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "friday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "saturday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      },
                      "sunday": {
                        "type": [
                          "array",
                          "null"
                        ],
                        "items": {
                          "type": "object",
                          "properties": {
                            "user_id": {
                              "type": "number"
                            },
                            "weight": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          }
                        }
                      }
                    }
                  }
                }
              },
              "weekly_schedule": {
                "type": "object",
                "properties": {
                  "monday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "tuesday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "wednesday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "thursday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "friday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "saturday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "sunday": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "start_time",
                        "end_time"
                      ],
                      "properties": {
                        "start_time": {
                          "type": "string"
                        },
                        "end_time": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "mcp_tools": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "required": [
                "url",
                "label",
                "authentication_type"
              ],
              "properties": {
                "url": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "authentication_type": {
                  "type": "string",
                  "enum": [
                    "none",
                    "api_key",
                    "custom_headers",
                    "oauth2"
                  ]
                },
                "api_key": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "custom_headers": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "key",
                      "value"
                    ],
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    }
                  }
                },
                "oauth2_config": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "authorization_server_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "client_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "client_secret": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "access_token": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "refresh_token": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "token_expiry": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "resource_uri": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scopes": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "enabled_tools": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "tools": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "inputSchema": {
                        "type": [
                          "object",
                          "null"
                        ]
                      }
                    }
                  }
                },
                "needs_reauthorization": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              }
            }
          },
          "is_easy_mode": {
            "type": "boolean",
            "default": true
          },
          "easy_mode_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "brand": {
                "type": "string"
              },
              "assistantName": {
                "type": "string"
              },
              "role": {
                "type": "string"
              },
              "objectives": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "restrictions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "additionalInstructions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "products": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "promotions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "conversationFlows": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "companyLocations": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "dialectSections": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "dynamicSections": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "voice_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "default": false
          },
          "telnyx_ai_assistant_config": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "telnyx_assistant_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_runtime": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "telnyx_builtin",
                  "custom_llm",
                  "openai_realtime_sip"
                ]
              },
              "voice_provider": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[a-z0-9_-]+$"
              },
              "voice_provider_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "unified",
                  "distinct"
                ]
              },
              "sync_status": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "synced",
                  "pending",
                  "error"
                ]
              },
              "last_synced_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "enabled_tools": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "webhook_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "use_custom_llm": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "custom_llm_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "openai_realtime_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "openai_realtime_voice": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "openai_realtime_sip_uri": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "greeting": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_speed": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "voice_language_boost": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_expressive_mode": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "voice_similarity_boost": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "voice_style": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "voice_use_speaker_boost": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "background_audio": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "predefined_media",
                      "media_url",
                      "media_name"
                    ]
                  },
                  "value": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "transcription_model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transcription_language": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transcription_region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transcription_settings": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "eot_threshold": {
                    "type": "number",
                    "minimum": 0.5,
                    "maximum": 0.9
                  },
                  "eot_timeout_ms": {
                    "type": "integer",
                    "minimum": 500,
                    "maximum": 10000
                  },
                  "eager_eot_threshold": {
                    "type": "number",
                    "minimum": 0.3,
                    "maximum": 0.9
                  },
                  "keyterm": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "context": {
                    "type": "string",
                    "maxLength": 10000
                  }
                }
              },
              "interruption_enable": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "speaking_wait_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "speaking_on_punctuation_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "speaking_on_no_punctuation_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "speaking_on_number_seconds": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "supports_unauthenticated_web_calls": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "delivery_status_webhook_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "enabled_features": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "data_retention": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "dynamic_variables_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "dynamic_variables_defaults": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "dynamic_variables_automation_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "dynamic_variables_webhook_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "dynamic_variables_webhook_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "widget_settings": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "voice_api_key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voice_api_key_ref": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "transfer_from_number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "external_transfer_caller_id_mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "company_number",
                  "original_caller"
                ]
              },
              "elevenlabs_agent_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "imported_from": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "telnyx_tools": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "object"
                }
              },
              "knowledge_bucket_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "knowledge_document_key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "knowledge_embedding_task_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "knowledge_last_synced_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "knowledge_content_hash": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "hangup_tool_description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "post_conversation_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "post_conversation_instructions": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "error_message": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "debug_webhook_base_url": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "AiAssistantsChangeHistory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "ai_assistant_id",
          "configuration"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "ai_assistant_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "configuration": {
            "type": "object",
            "description": "JSON configuration of the AI assistant"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AiAssistantsChangeHistoryData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "ai_assistant_id",
          "configuration"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "ai_assistant_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "configuration": {
            "type": "object",
            "description": "JSON configuration of the AI assistant"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AiAssistantsChangeHistoryPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "ai_assistant_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "configuration": {
            "type": "object",
            "description": "JSON configuration of the AI assistant"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AiModels": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "provider",
          "model_name"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "provider": {
            "type": "string",
            "enum": [
              "openai",
              "openrouter"
            ]
          },
          "model_name": {
            "type": "string"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "small_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "intelligence": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Intelligence rating from 1 to 5"
          },
          "reasoning": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Reasoning capability rating from 1 to 5"
          },
          "cost": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Cost efficiency rating from 1 to 5 (5 = most cost efficient)"
          },
          "speed": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Response speed rating from 1 to 5"
          },
          "input_price_per_1m_tokens": {
            "type": "number",
            "description": "Price per 1 million input tokens in USD"
          },
          "output_price_per_1m_tokens": {
            "type": "number",
            "description": "Price per 1 million output tokens in USD"
          },
          "status": {
            "type": "string",
            "enum": [
              "visible",
              "not_visible_but_supported",
              "not_supported"
            ],
            "default": "not_supported"
          },
          "active_in_conversations": {
            "type": "boolean",
            "default": true,
            "description": "Whether the model is active for use in conversations"
          },
          "active_in_tickets": {
            "type": "boolean",
            "default": true,
            "description": "Whether the model is active for use in tickets"
          },
          "active_in_ai_chat": {
            "type": "boolean",
            "default": true,
            "description": "Whether the model is active for use in AI chat"
          },
          "active_in_voice": {
            "type": "boolean",
            "default": false,
            "description": "Whether the model is active for use in voice assistants (Telnyx)"
          },
          "provider_metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Raw metadata from the provider API (OpenRouter, etc.) stored as JSONB"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AiModelsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "model_name"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "provider": {
            "type": "string",
            "enum": [
              "openai",
              "openrouter"
            ]
          },
          "model_name": {
            "type": "string"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "small_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "intelligence": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Intelligence rating from 1 to 5"
          },
          "reasoning": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Reasoning capability rating from 1 to 5"
          },
          "cost": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Cost efficiency rating from 1 to 5 (5 = most cost efficient)"
          },
          "speed": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Response speed rating from 1 to 5"
          },
          "input_price_per_1m_tokens": {
            "type": "number",
            "description": "Price per 1 million input tokens in USD"
          },
          "output_price_per_1m_tokens": {
            "type": "number",
            "description": "Price per 1 million output tokens in USD"
          },
          "status": {
            "type": "string",
            "enum": [
              "visible",
              "not_visible_but_supported",
              "not_supported"
            ],
            "default": "not_supported"
          },
          "active_in_conversations": {
            "type": "boolean",
            "default": true,
            "description": "Whether the model is active for use in conversations"
          },
          "active_in_tickets": {
            "type": "boolean",
            "default": true,
            "description": "Whether the model is active for use in tickets"
          },
          "active_in_ai_chat": {
            "type": "boolean",
            "default": true,
            "description": "Whether the model is active for use in AI chat"
          },
          "active_in_voice": {
            "type": "boolean",
            "default": false,
            "description": "Whether the model is active for use in voice assistants (Telnyx)"
          },
          "provider_metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Raw metadata from the provider API (OpenRouter, etc.) stored as JSONB"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AiModelsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "provider": {
            "type": "string",
            "enum": [
              "openai",
              "openrouter"
            ]
          },
          "model_name": {
            "type": "string"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "small_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "intelligence": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Intelligence rating from 1 to 5"
          },
          "reasoning": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Reasoning capability rating from 1 to 5"
          },
          "cost": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Cost efficiency rating from 1 to 5 (5 = most cost efficient)"
          },
          "speed": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5,
            "description": "Response speed rating from 1 to 5"
          },
          "input_price_per_1m_tokens": {
            "type": "number",
            "description": "Price per 1 million input tokens in USD"
          },
          "output_price_per_1m_tokens": {
            "type": "number",
            "description": "Price per 1 million output tokens in USD"
          },
          "status": {
            "type": "string",
            "enum": [
              "visible",
              "not_visible_but_supported",
              "not_supported"
            ],
            "default": "not_supported"
          },
          "active_in_conversations": {
            "type": "boolean",
            "default": true,
            "description": "Whether the model is active for use in conversations"
          },
          "active_in_tickets": {
            "type": "boolean",
            "default": true,
            "description": "Whether the model is active for use in tickets"
          },
          "active_in_ai_chat": {
            "type": "boolean",
            "default": true,
            "description": "Whether the model is active for use in AI chat"
          },
          "active_in_voice": {
            "type": "boolean",
            "default": false,
            "description": "Whether the model is active for use in voice assistants (Telnyx)"
          },
          "provider_metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Raw metadata from the provider API (OpenRouter, etc.) stored as JSONB"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ApiTools": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "name",
          "endpoint",
          "method",
          "parameters_schema",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST"
            ]
          },
          "parameters_schema": {
            "type": "object"
          },
          "url_parameters": {
            "type": [
              "array",
              "null"
            ]
          },
          "body_parameters": {
            "type": [
              "array",
              "null"
            ]
          },
          "headers": {
            "type": [
              "object",
              "null"
            ]
          },
          "response_example": {
            "type": [
              "object",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ApiToolsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "name",
          "endpoint",
          "method",
          "parameters_schema"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST"
            ]
          },
          "parameters_schema": {
            "type": "object"
          },
          "url_parameters": {
            "type": [
              "array",
              "null"
            ]
          },
          "body_parameters": {
            "type": [
              "array",
              "null"
            ]
          },
          "headers": {
            "type": [
              "object",
              "null"
            ]
          },
          "response_example": {
            "type": [
              "object",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ApiToolsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST"
            ]
          },
          "parameters_schema": {
            "type": "object"
          },
          "url_parameters": {
            "type": [
              "array",
              "null"
            ]
          },
          "body_parameters": {
            "type": [
              "array",
              "null"
            ]
          },
          "headers": {
            "type": [
              "object",
              "null"
            ]
          },
          "response_example": {
            "type": [
              "object",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AutomationsExecutions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "automation_id",
          "organization_id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "automation_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "conversation_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ticket_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "triggered_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "triggered_by_ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "campaign_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "series_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "series_step_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "series_subscription_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "initial_payload": {
            "type": [
              "object",
              "null"
            ]
          },
          "automation_flow": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "nodes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "position": {
                      "type": "object",
                      "properties": {
                        "x": {
                          "type": "number"
                        },
                        "y": {
                          "type": "number"
                        }
                      }
                    },
                    "width": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "height": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "edges": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "sourceHandle": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "targetHandle": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              },
              "viewport": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "x": {
                    "type": "number"
                  },
                  "y": {
                    "type": "number"
                  },
                  "zoom": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "response_body": {
            "type": [
              "object",
              "null"
            ]
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AutomationsExecutionsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "automation_id",
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "automation_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "conversation_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ticket_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "triggered_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "triggered_by_ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "campaign_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "series_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "series_step_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "series_subscription_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "initial_payload": {
            "type": [
              "object",
              "null"
            ]
          },
          "automation_flow": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "nodes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "position": {
                      "type": "object",
                      "properties": {
                        "x": {
                          "type": "number"
                        },
                        "y": {
                          "type": "number"
                        }
                      }
                    },
                    "width": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "height": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "edges": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "sourceHandle": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "targetHandle": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              },
              "viewport": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "x": {
                    "type": "number"
                  },
                  "y": {
                    "type": "number"
                  },
                  "zoom": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "response_body": {
            "type": [
              "object",
              "null"
            ]
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AutomationsExecutionsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "automation_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "conversation_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ticket_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "triggered_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "triggered_by_ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "campaign_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "series_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "series_step_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "series_subscription_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "initial_payload": {
            "type": [
              "object",
              "null"
            ]
          },
          "automation_flow": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "nodes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "position": {
                      "type": "object",
                      "properties": {
                        "x": {
                          "type": "number"
                        },
                        "y": {
                          "type": "number"
                        }
                      }
                    },
                    "width": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "height": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "edges": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "sourceHandle": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "targetHandle": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              },
              "viewport": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "x": {
                    "type": "number"
                  },
                  "y": {
                    "type": "number"
                  },
                  "zoom": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "response_body": {
            "type": [
              "object",
              "null"
            ]
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CampaignSegments": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "channel",
          "created_by_user_id",
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "channel": {
            "type": "string",
            "enum": [
              "whatsapp",
              "instagram",
              "messenger",
              "email",
              "automation",
              "sms",
              "ai_calling"
            ]
          },
          "query": {
            "type": [
              "object",
              "null"
            ]
          },
          "builder_type": {
            "type": "string",
            "enum": [
              "manual",
              "ai"
            ]
          },
          "ai_sql_query": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "ai_explanation": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "ai_prompt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CampaignSegmentsData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "channel": {
            "type": "string",
            "enum": [
              "whatsapp",
              "instagram",
              "messenger",
              "email",
              "automation",
              "sms",
              "ai_calling"
            ]
          },
          "query": {
            "type": [
              "object",
              "null"
            ]
          },
          "builder_type": {
            "type": "string",
            "enum": [
              "manual",
              "ai"
            ]
          },
          "ai_sql_query": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "ai_explanation": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "ai_prompt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CampaignSegmentsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "channel": {
            "type": "string",
            "enum": [
              "whatsapp",
              "instagram",
              "messenger",
              "email",
              "automation",
              "sms",
              "ai_calling"
            ]
          },
          "query": {
            "type": [
              "object",
              "null"
            ]
          },
          "builder_type": {
            "type": "string",
            "enum": [
              "manual",
              "ai"
            ]
          },
          "ai_sql_query": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "ai_explanation": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "ai_prompt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Companies": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "owned_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          }
        }
      },
      "CompaniesData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "owned_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          }
        }
      },
      "CompaniesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "owned_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          }
        }
      },
      "Contacts": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_country_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_country_iso": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "owned_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "channel_whatsapp_wa_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_whatsapp_wa_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_whatsapp_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_instagram_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_psid": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_facebook_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "whatsapp_blacklist": {
            "type": "boolean",
            "default": false
          },
          "whatsapp_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "sms_blacklist": {
            "type": "boolean",
            "default": false
          },
          "sms_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "sms_opt_in_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sms_opt_in_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "voice_blacklist": {
            "type": "boolean",
            "default": false
          },
          "voice_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "instagram_blacklist": {
            "type": "boolean",
            "default": false
          },
          "instagram_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "messenger_blacklist": {
            "type": "boolean",
            "default": false
          },
          "messenger_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "dnd_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dnd_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "system_type": {
            "type": "string",
            "enum": [
              "conversation",
              "lead",
              "contact"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          }
        }
      },
      "ContactsData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_country_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_country_iso": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "owned_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "channel_whatsapp_wa_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_whatsapp_wa_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_whatsapp_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_instagram_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_psid": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_facebook_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "whatsapp_blacklist": {
            "type": "boolean",
            "default": false
          },
          "whatsapp_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "sms_blacklist": {
            "type": "boolean",
            "default": false
          },
          "sms_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "sms_opt_in_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sms_opt_in_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "voice_blacklist": {
            "type": "boolean",
            "default": false
          },
          "voice_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "instagram_blacklist": {
            "type": "boolean",
            "default": false
          },
          "instagram_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "messenger_blacklist": {
            "type": "boolean",
            "default": false
          },
          "messenger_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "dnd_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dnd_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "system_type": {
            "type": "string",
            "enum": [
              "conversation",
              "lead",
              "contact"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          }
        }
      },
      "ContactsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_country_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_country_iso": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "owned_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "channel_whatsapp_wa_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_whatsapp_wa_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_whatsapp_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_instagram_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_psid": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_facebook_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "whatsapp_blacklist": {
            "type": "boolean",
            "default": false
          },
          "whatsapp_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "sms_blacklist": {
            "type": "boolean",
            "default": false
          },
          "sms_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "sms_opt_in_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sms_opt_in_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "voice_blacklist": {
            "type": "boolean",
            "default": false
          },
          "voice_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "instagram_blacklist": {
            "type": "boolean",
            "default": false
          },
          "instagram_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "messenger_blacklist": {
            "type": "boolean",
            "default": false
          },
          "messenger_blacklist_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "dnd_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dnd_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "system_type": {
            "type": "string",
            "enum": [
              "conversation",
              "lead",
              "contact"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          }
        }
      },
      "ConversationFiles": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "_id",
          "conversation_id",
          "file_name",
          "file_type",
          "file_size",
          "file_category"
        ],
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "organization_id": {
            "type": "string"
          },
          "conversation_id": {
            "type": "integer"
          },
          "file_name": {
            "type": "string"
          },
          "file_type": {
            "type": "string"
          },
          "file_size": {
            "type": "integer"
          },
          "file_category": {
            "type": "string"
          }
        }
      },
      "ConversationFilesData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "conversation_id",
          "file_name",
          "file_type",
          "file_size",
          "file_category"
        ],
        "properties": {
          "organization_id": {
            "type": "integer"
          },
          "organizationId": {
            "type": "string"
          },
          "conversation_id": {
            "type": "integer"
          },
          "file_name": {
            "type": "string"
          },
          "file_type": {
            "type": "string"
          },
          "file_size": {
            "type": "integer"
          },
          "file_category": {
            "type": "string"
          }
        }
      },
      "ConversationFilesPatch": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "organization_id": {
            "type": "string"
          },
          "conversation_id": {
            "type": "integer"
          },
          "file_name": {
            "type": "string"
          },
          "file_type": {
            "type": "string"
          },
          "file_size": {
            "type": "integer"
          },
          "file_category": {
            "type": "string"
          }
        }
      },
      "ConversationMessagesInstagram": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "_id"
        ],
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "location_latitude": {
            "type": "number"
          },
          "location_longitude": {
            "type": "number"
          },
          "location_address": {
            "type": "string"
          },
          "location_name": {
            "type": "string"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesInstagramData": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "location_latitude": {
            "type": "number"
          },
          "location_longitude": {
            "type": "number"
          },
          "location_address": {
            "type": "string"
          },
          "location_name": {
            "type": "string"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesInstagramPatch": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "location_latitude": {
            "type": "number"
          },
          "location_longitude": {
            "type": "number"
          },
          "location_address": {
            "type": "string"
          },
          "location_name": {
            "type": "string"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesMessenger": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "_id"
        ],
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "messenger_status": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination": {
            "type": "string"
          },
          "organization_id": {
            "type": "number"
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_user_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesMessengerData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "organization_id",
          "conversation_id",
          "message_type"
        ],
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "messenger_status": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination": {
            "type": "string"
          },
          "organization_id": {
            "type": "number"
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_user_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesMessengerPatch": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "messenger_status": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination": {
            "type": "string"
          },
          "organization_id": {
            "type": "number"
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_user_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesPlayground": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "conversation_id",
          "organization_id",
          "message_type",
          "destination"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "conversation_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "message_type": {
            "type": "string"
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing",
              "system"
            ]
          },
          "role": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_user_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "s3_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "s3_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_size": {
            "type": [
              "number",
              "null"
            ]
          },
          "conversation_file_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ]
          },
          "change_metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "tool_metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "automation_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "automation_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "automation_execution_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "is_from_automation": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "follow_up_details": {
            "type": [
              "object",
              "null"
            ]
          },
          "error": {
            "type": [
              "object",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ConversationMessagesPlaygroundData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "conversation_id",
          "organization_id",
          "message_type",
          "destination"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "conversation_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "message_type": {
            "type": "string"
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing",
              "system"
            ]
          },
          "role": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_user_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "s3_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "s3_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_size": {
            "type": [
              "number",
              "null"
            ]
          },
          "conversation_file_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ]
          },
          "change_metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "tool_metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "automation_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "automation_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "automation_execution_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "is_from_automation": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "follow_up_details": {
            "type": [
              "object",
              "null"
            ]
          },
          "error": {
            "type": [
              "object",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ConversationMessagesPlaygroundPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "conversation_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "message_type": {
            "type": "string"
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing",
              "system"
            ]
          },
          "role": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_user_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "s3_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "s3_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_size": {
            "type": [
              "number",
              "null"
            ]
          },
          "conversation_file_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ]
          },
          "change_metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "tool_metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "automation_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "automation_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "automation_execution_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "is_from_automation": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "follow_up_details": {
            "type": [
              "object",
              "null"
            ]
          },
          "error": {
            "type": [
              "object",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ConversationMessagesSms": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "conversation_id",
          "organization_id",
          "text"
        ],
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "conversation_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "text": {
            "type": "string"
          },
          "message_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video",
              "audio",
              "document",
              "media",
              "template",
              "reaction",
              "note"
            ],
            "default": "text"
          },
          "destination": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing",
              "system"
            ],
            "default": "incoming"
          },
          "from": {
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "queued",
              "sent",
              "delivered",
              "failed",
              "received"
            ]
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "media_urls": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "filename": {
            "type": [
              "string",
              "null"
            ]
          },
          "mime_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_deleted": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "meta_user_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "is_echo": {
            "type": "boolean",
            "default": false
          },
          "is_bulk": {
            "type": "boolean",
            "default": false
          },
          "campaign_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ConversationMessagesSmsData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "conversation_id",
          "organization_id",
          "text"
        ],
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "conversation_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "text": {
            "type": "string"
          },
          "message_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video",
              "audio",
              "document",
              "media",
              "template",
              "reaction",
              "note"
            ],
            "default": "text"
          },
          "destination": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing",
              "system"
            ],
            "default": "incoming"
          },
          "from": {
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "queued",
              "sent",
              "delivered",
              "failed",
              "received"
            ]
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "media_urls": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "filename": {
            "type": [
              "string",
              "null"
            ]
          },
          "mime_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_deleted": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "meta_user_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "is_echo": {
            "type": "boolean",
            "default": false
          },
          "is_bulk": {
            "type": "boolean",
            "default": false
          },
          "campaign_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ConversationMessagesSmsPatch": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "conversation_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "text": {
            "type": "string"
          },
          "message_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video",
              "audio",
              "document",
              "media",
              "template",
              "reaction",
              "note"
            ],
            "default": "text"
          },
          "destination": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing",
              "system"
            ],
            "default": "incoming"
          },
          "from": {
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "queued",
              "sent",
              "delivered",
              "failed",
              "received"
            ]
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "media_urls": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "filename": {
            "type": [
              "string",
              "null"
            ]
          },
          "mime_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_deleted": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "meta_user_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_user_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "is_echo": {
            "type": "boolean",
            "default": false
          },
          "is_bulk": {
            "type": "boolean",
            "default": false
          },
          "campaign_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ConversationMessagesWebchat": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "_id"
        ],
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "file_size": {
            "type": "number"
          },
          "conversation_file_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "destination": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing",
              "system"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesWebchatData": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "file_size": {
            "type": "number"
          },
          "conversation_file_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "destination": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing",
              "system"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesWebchatPatch": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "file_size": {
            "type": "number"
          },
          "conversation_file_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "destination": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing",
              "system"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesWhatsapp": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "_id"
        ],
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "campaign_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "whatsapp_status": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "location_latitude": {
            "type": "string"
          },
          "location_longitude": {
            "type": "string"
          },
          "location_address": {
            "type": "string"
          },
          "location_name": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "revoked": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "edited": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "message_text_original": {
            "type": [
              "string",
              "null"
            ]
          },
          "order_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "interactive_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "interactive_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "button_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesWhatsappData": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "campaign_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "whatsapp_status": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "location_latitude": {
            "type": "string"
          },
          "location_longitude": {
            "type": "string"
          },
          "location_address": {
            "type": "string"
          },
          "location_name": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "revoked": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "edited": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "message_text_original": {
            "type": [
              "string",
              "null"
            ]
          },
          "order_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "interactive_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "interactive_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "button_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationMessagesWhatsappPatch": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            ]
          },
          "text": {
            "type": "string"
          },
          "conversation_id": {
            "type": "number"
          },
          "campaign_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "message_type": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "whatsapp_status": {
            "type": "string"
          },
          "media_url": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "location_latitude": {
            "type": "string"
          },
          "location_longitude": {
            "type": "string"
          },
          "location_address": {
            "type": "string"
          },
          "location_name": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "read": {
            "type": "boolean",
            "default": false
          },
          "revoked": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "edited": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "message_text_original": {
            "type": [
              "string",
              "null"
            ]
          },
          "order_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "interactive_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "interactive_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "button_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "ai_assistant_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_model": {
            "type": [
              "object",
              "null"
            ]
          },
          "ai_structured_data": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ConversationPredefinedMessages": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "content",
          "organization_id",
          "created_by_user_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "title": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "message_type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video",
              "document",
              "audio",
              "location"
            ],
            "default": "text"
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "filename": {
            "type": [
              "string",
              "null"
            ]
          },
          "mime_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ConversationPredefinedMessagesData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "content",
          "organization_id",
          "created_by_user_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "title": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "message_type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video",
              "document",
              "audio",
              "location"
            ],
            "default": "text"
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "filename": {
            "type": [
              "string",
              "null"
            ]
          },
          "mime_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ConversationPredefinedMessagesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "title": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "message_type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video",
              "document",
              "audio",
              "location"
            ],
            "default": "text"
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "filename": {
            "type": [
              "string",
              "null"
            ]
          },
          "mime_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Conversations": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "contact_id",
          "channel"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "whatsapp_channel_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "our_phone_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "voice_phone_number_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_id": {
            "type": "number"
          },
          "pipeline_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "pipeline_stage_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "whatsapp",
              "instagram",
              "messenger",
              "webchat",
              "playground",
              "sms"
            ]
          },
          "meta_contact_first_name": {
            "type": "string"
          },
          "meta_contact_last_name": {
            "type": "string"
          },
          "meta_contact_channel_wa_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_profile_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_instagram_profile_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "unread_count": {
            "type": "number",
            "default": 0
          },
          "last_message_received": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_sent": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_system": {
            "type": "string",
            "format": "date-time"
          },
          "last_interaction_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_sent_preview": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ],
            "default": "open"
          },
          "ai_context_cut": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ai_resume_instruction": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_resume_instruction_set_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "handoff_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_follow_up_rule_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_follow_up_date_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "follow_up_count": {
            "type": "number",
            "default": 0
          },
          "last_ai_response_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "token_limit_reached_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "token_limit_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_auto_assignment_disabled": {
            "type": "boolean",
            "default": false
          },
          "ai_auto_assignment_disabled_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "blocked": {
            "type": "boolean",
            "default": false
          },
          "conversation_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "conversation_summary_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pinned_messages": {
            "type": "array",
            "maxItems": 3,
            "default": [],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "message_id",
                "message_type",
                "preview",
                "pinned_at"
              ],
              "properties": {
                "message_id": {
                  "type": "string",
                  "maxLength": 80
                },
                "message_type": {
                  "type": "string"
                },
                "preview": {
                  "type": "string",
                  "maxLength": 2000
                },
                "destination": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "pinned_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "pinned_by_user_id": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "ConversationsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "contact_id",
          "channel"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "whatsapp_channel_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "our_phone_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "voice_phone_number_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_id": {
            "type": "number"
          },
          "pipeline_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "pipeline_stage_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "whatsapp",
              "instagram",
              "messenger",
              "webchat",
              "playground",
              "sms"
            ]
          },
          "meta_contact_first_name": {
            "type": "string"
          },
          "meta_contact_last_name": {
            "type": "string"
          },
          "meta_contact_channel_wa_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_profile_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_instagram_profile_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "unread_count": {
            "type": "number",
            "default": 0
          },
          "last_message_received": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_sent": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_system": {
            "type": "string",
            "format": "date-time"
          },
          "last_interaction_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_sent_preview": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ],
            "default": "open"
          },
          "ai_context_cut": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ai_resume_instruction": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_resume_instruction_set_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "handoff_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_follow_up_rule_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_follow_up_date_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "follow_up_count": {
            "type": "number",
            "default": 0
          },
          "last_ai_response_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "token_limit_reached_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "token_limit_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_auto_assignment_disabled": {
            "type": "boolean",
            "default": false
          },
          "ai_auto_assignment_disabled_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "blocked": {
            "type": "boolean",
            "default": false
          },
          "conversation_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "conversation_summary_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pinned_messages": {
            "type": "array",
            "maxItems": 3,
            "default": [],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "message_id",
                "message_type",
                "preview",
                "pinned_at"
              ],
              "properties": {
                "message_id": {
                  "type": "string",
                  "maxLength": 80
                },
                "message_type": {
                  "type": "string"
                },
                "preview": {
                  "type": "string",
                  "maxLength": 2000
                },
                "destination": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "pinned_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "pinned_by_user_id": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "ConversationsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "whatsapp_channel_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "our_phone_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "voice_phone_number_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact_id": {
            "type": "number"
          },
          "pipeline_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "pipeline_stage_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "whatsapp",
              "instagram",
              "messenger",
              "webchat",
              "playground",
              "sms"
            ]
          },
          "meta_contact_first_name": {
            "type": "string"
          },
          "meta_contact_last_name": {
            "type": "string"
          },
          "meta_contact_channel_wa_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_wa_profile_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_channel_instagram_profile_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "unread_count": {
            "type": "number",
            "default": 0
          },
          "last_message_received": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_sent": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_system": {
            "type": "string",
            "format": "date-time"
          },
          "last_interaction_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_sent_preview": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ],
            "default": "open"
          },
          "ai_context_cut": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ai_resume_instruction": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_resume_instruction_set_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "handoff_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_follow_up_rule_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_follow_up_date_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "follow_up_count": {
            "type": "number",
            "default": 0
          },
          "last_ai_response_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "token_limit_reached_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "token_limit_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_auto_assignment_disabled": {
            "type": "boolean",
            "default": false
          },
          "ai_auto_assignment_disabled_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "blocked": {
            "type": "boolean",
            "default": false
          },
          "conversation_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "conversation_summary_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pinned_messages": {
            "type": "array",
            "maxItems": 3,
            "default": [],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "message_id",
                "message_type",
                "preview",
                "pinned_at"
              ],
              "properties": {
                "message_id": {
                  "type": "string",
                  "maxLength": 80
                },
                "message_type": {
                  "type": "string"
                },
                "preview": {
                  "type": "string",
                  "maxLength": 2000
                },
                "destination": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "pinned_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "pinned_by_user_id": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "ConversationsBulkActions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "created_by_user_id",
          "action"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "action": {
            "type": "string",
            "enum": [
              "assign",
              "update_status",
              "assign_ai_assistant",
              "move",
              "cut_ai_context"
            ]
          },
          "conversation_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "number"
            }
          },
          "view_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "filter": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "organization_id": {
                "type": "number"
              },
              "pipeline_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "pipeline_stage_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "open",
                  "closed"
                ]
              },
              "channel": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "whatsapp",
                  "instagram",
                  "messenger",
                  "webchat",
                  "playground",
                  "sms"
                ]
              },
              "assigned_user_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "assigned_ai_assistant_id": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          },
          "action_params": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed"
            ],
            "default": "pending"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "processed_count": {
            "type": "number",
            "default": 0
          },
          "failed_count": {
            "type": "number",
            "default": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ConversationsBulkActionsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "action"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "action": {
            "type": "string",
            "enum": [
              "assign",
              "update_status",
              "assign_ai_assistant",
              "move",
              "cut_ai_context"
            ]
          },
          "conversation_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "number"
            }
          },
          "view_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "filter": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "organization_id": {
                "type": "number"
              },
              "pipeline_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "pipeline_stage_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "open",
                  "closed"
                ]
              },
              "channel": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "whatsapp",
                  "instagram",
                  "messenger",
                  "webchat",
                  "playground",
                  "sms"
                ]
              },
              "assigned_user_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "assigned_ai_assistant_id": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          },
          "action_params": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed"
            ],
            "default": "pending"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "processed_count": {
            "type": "number",
            "default": 0
          },
          "failed_count": {
            "type": "number",
            "default": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ConversationsBulkActionsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "action": {
            "type": "string",
            "enum": [
              "assign",
              "update_status",
              "assign_ai_assistant",
              "move",
              "cut_ai_context"
            ]
          },
          "conversation_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "number"
            }
          },
          "view_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "filter": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "organization_id": {
                "type": "number"
              },
              "pipeline_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "pipeline_stage_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "open",
                  "closed"
                ]
              },
              "channel": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "whatsapp",
                  "instagram",
                  "messenger",
                  "webchat",
                  "playground",
                  "sms"
                ]
              },
              "assigned_user_id": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "assigned_ai_assistant_id": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          },
          "action_params": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed"
            ],
            "default": "pending"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "processed_count": {
            "type": "number",
            "default": 0
          },
          "failed_count": {
            "type": "number",
            "default": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CustomFields": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "fieldType",
          "isRequired",
          "organization_id",
          "entity_type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "fieldType": {
            "type": "string",
            "enum": [
              "text",
              "textarea",
              "number",
              "date",
              "time",
              "datetime",
              "boolean",
              "select",
              "multiselect",
              "email",
              "url",
              "phone",
              "file",
              "multifile",
              "image",
              "currency",
              "json"
            ]
          },
          "isRequired": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string"
                },
                "order": {
                  "type": "integer"
                }
              },
              "required": [
                "value",
                "order"
              ]
            }
          },
          "organization_id": {
            "type": "number"
          },
          "system_currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "custom_field_category_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "position": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "entity_type": {
            "type": "string",
            "enum": [
              "contact",
              "company",
              "deal",
              "ticket",
              "reservation",
              "sales_document",
              "product"
            ]
          }
        }
      },
      "CustomFieldsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "fieldType",
          "isRequired",
          "organization_id",
          "entity_type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "fieldType": {
            "type": "string",
            "enum": [
              "text",
              "textarea",
              "number",
              "date",
              "time",
              "datetime",
              "boolean",
              "select",
              "multiselect",
              "email",
              "url",
              "phone",
              "file",
              "multifile",
              "image",
              "currency",
              "json"
            ]
          },
          "isRequired": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string"
                },
                "order": {
                  "type": "integer"
                }
              },
              "required": [
                "value",
                "order"
              ]
            }
          },
          "organization_id": {
            "type": "number"
          },
          "system_currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "custom_field_category_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "position": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "entity_type": {
            "type": "string",
            "enum": [
              "contact",
              "company",
              "deal",
              "ticket",
              "reservation",
              "sales_document",
              "product"
            ]
          }
        }
      },
      "CustomFieldsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "fieldType": {
            "type": "string",
            "enum": [
              "text",
              "textarea",
              "number",
              "date",
              "time",
              "datetime",
              "boolean",
              "select",
              "multiselect",
              "email",
              "url",
              "phone",
              "file",
              "multifile",
              "image",
              "currency",
              "json"
            ]
          },
          "isRequired": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string"
                },
                "order": {
                  "type": "integer"
                }
              },
              "required": [
                "value",
                "order"
              ]
            }
          },
          "organization_id": {
            "type": "number"
          },
          "system_currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "custom_field_category_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "position": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "entity_type": {
            "type": "string",
            "enum": [
              "contact",
              "company",
              "deal",
              "ticket",
              "reservation",
              "sales_document",
              "product"
            ]
          }
        }
      },
      "DealProducts": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "deal_id",
          "name",
          "quantity",
          "price"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "deal_id": {
            "type": "number"
          },
          "product_id": {
            "type": "number"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "main_media_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "number",
            "default": 0
          },
          "price": {
            "type": "number",
            "default": 0
          },
          "discount_type": {
            "type": "string",
            "enum": [
              "fixed",
              "percentage",
              "none"
            ],
            "default": "none"
          },
          "discount_amount": {
            "type": "number",
            "default": 0
          },
          "discount_percentage": {
            "type": "number",
            "default": 0
          },
          "tax_percentage": {
            "type": "number",
            "default": 0
          },
          "total_amount_with_tax": {
            "type": "number"
          },
          "total_amount_without_tax": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "DealProductsData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "deal_id": {
            "type": "number"
          },
          "product_id": {
            "type": "number"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "main_media_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "number",
            "default": 0
          },
          "price": {
            "type": "number",
            "default": 0
          },
          "discount_type": {
            "type": "string",
            "enum": [
              "fixed",
              "percentage",
              "none"
            ],
            "default": "none"
          },
          "discount_amount": {
            "type": "number",
            "default": 0
          },
          "discount_percentage": {
            "type": "number",
            "default": 0
          },
          "tax_percentage": {
            "type": "number",
            "default": 0
          },
          "total_amount_with_tax": {
            "type": "number"
          },
          "total_amount_without_tax": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "DealProductsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "deal_id": {
            "type": "number"
          },
          "product_id": {
            "type": "number"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "main_media_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "number",
            "default": 0
          },
          "price": {
            "type": "number",
            "default": 0
          },
          "discount_type": {
            "type": "string",
            "enum": [
              "fixed",
              "percentage",
              "none"
            ],
            "default": "none"
          },
          "discount_amount": {
            "type": "number",
            "default": 0
          },
          "discount_percentage": {
            "type": "number",
            "default": 0
          },
          "tax_percentage": {
            "type": "number",
            "default": 0
          },
          "total_amount_with_tax": {
            "type": "number"
          },
          "total_amount_without_tax": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Deals": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "organization_id",
          "pipeline_id",
          "pipeline_stage_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "currency_id": {
            "type": "number"
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency_symbol": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency_format": {
            "type": [
              "string",
              "null"
            ]
          },
          "decimal_places": {
            "type": [
              "number",
              "null"
            ],
            "default": 2
          },
          "thousand_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": ","
          },
          "decimal_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": "."
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "won",
              "lost"
            ]
          },
          "expected_close_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "won_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lost_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deal_lost_reason_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "deal_lost_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "pipeline_id": {
            "type": "number"
          },
          "pipeline_stage_id": {
            "type": "number"
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "owned_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          }
        }
      },
      "DealsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "organization_id",
          "pipeline_id",
          "pipeline_stage_id",
          "contact_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "currency_id": {
            "type": "number"
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency_symbol": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency_format": {
            "type": [
              "string",
              "null"
            ]
          },
          "decimal_places": {
            "type": [
              "number",
              "null"
            ],
            "default": 2
          },
          "thousand_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": ","
          },
          "decimal_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": "."
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "won",
              "lost"
            ]
          },
          "expected_close_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "won_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lost_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deal_lost_reason_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "deal_lost_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "pipeline_id": {
            "type": "number"
          },
          "pipeline_stage_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "owned_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          }
        }
      },
      "DealsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "currency_id": {
            "type": "number"
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency_symbol": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency_format": {
            "type": [
              "string",
              "null"
            ]
          },
          "decimal_places": {
            "type": [
              "number",
              "null"
            ],
            "default": 2
          },
          "thousand_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": ","
          },
          "decimal_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": "."
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "won",
              "lost"
            ]
          },
          "expected_close_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "won_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lost_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deal_lost_reason_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "deal_lost_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "pipeline_id": {
            "type": "number"
          },
          "pipeline_stage_id": {
            "type": "number"
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "owned_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "default": []
          }
        }
      },
      "LoyaltyMembers": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "program_id",
          "contact_id",
          "member_code"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "program_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "blocked"
            ]
          },
          "marketing_consent": {
            "type": "boolean"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "member_code": {
            "type": "string"
          },
          "balance": {
            "type": "number"
          },
          "lifetime_earned": {
            "type": "number"
          },
          "lifetime_redeemed": {
            "type": "number"
          },
          "lifetime_spend": {
            "type": "number"
          },
          "visits_count": {
            "type": "number"
          },
          "rewards_unlocked_count": {
            "type": "number"
          },
          "tier_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "uses_remaining": {
            "type": [
              "number",
              "null"
            ]
          },
          "enrolled_at": {
            "type": "string",
            "format": "date-time"
          },
          "enrollment_source": {
            "type": "string"
          },
          "referral_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "referred_by_member_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "consent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_activity_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_visit_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "wallet_serial": {
            "type": "string"
          },
          "google_object_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "google_object_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "apple_pass_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "apple_pass_installed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "google_pass_saved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LoyaltyMembersData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "program_id"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "organization_id": {
            "type": "number"
          },
          "program_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "blocked"
            ]
          },
          "marketing_consent": {
            "type": "boolean"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "enrollment_source": {
            "type": "string",
            "enum": [
              "public_page",
              "manual",
              "checkout",
              "automation",
              "api",
              "import",
              "ai_assistant",
              "referral",
              "purchase"
            ]
          },
          "referral_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "initial_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "contact": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "first_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "last_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "phone_country_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "phone_country_iso": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "LoyaltyMembersPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "blocked"
            ]
          },
          "marketing_consent": {
            "type": "boolean"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LoyaltyPrograms": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "name",
          "type",
          "status",
          "slug"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "type": {
            "type": "string",
            "enum": [
              "stamps",
              "points",
              "cashback",
              "membership",
              "gift_card"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "paused",
              "archived"
            ]
          },
          "slug": {
            "type": "string",
            "maxLength": 80
          },
          "currency_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 8
          },
          "earn_rules": {
            "type": [
              "object",
              "null"
            ]
          },
          "stamps_required": {
            "type": [
              "number",
              "null"
            ]
          },
          "cashback_percent": {
            "type": [
              "number",
              "null"
            ]
          },
          "welcome_bonus": {
            "type": "number"
          },
          "birthday_bonus": {
            "type": "number"
          },
          "referrals_enabled": {
            "type": "boolean"
          },
          "referrer_bonus": {
            "type": "number"
          },
          "referred_bonus": {
            "type": "number"
          },
          "expiration_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "min_redeem_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "membership_uses": {
            "type": [
              "number",
              "null"
            ]
          },
          "membership_validity_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "gift_card_default_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "tiers_enabled": {
            "type": "boolean"
          },
          "tier_basis": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "lifetime_points",
              "lifetime_spend",
              "visits"
            ]
          },
          "card_design": {
            "type": [
              "object",
              "null"
            ]
          },
          "locations": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object"
            }
          },
          "enrollment_settings": {
            "type": [
              "object",
              "null"
            ]
          },
          "terms": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10000
          },
          "public_enrollment_enabled": {
            "type": "boolean"
          },
          "apple_wallet_enabled": {
            "type": "boolean"
          },
          "google_wallet_enabled": {
            "type": "boolean"
          },
          "google_class_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "google_class_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "member_count": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LoyaltyProgramsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "name",
          "type"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "type": {
            "type": "string",
            "enum": [
              "stamps",
              "points",
              "cashback",
              "membership",
              "gift_card"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "paused",
              "archived"
            ]
          },
          "slug": {
            "type": "string",
            "maxLength": 80
          },
          "currency_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 8
          },
          "earn_rules": {
            "type": [
              "object",
              "null"
            ]
          },
          "stamps_required": {
            "type": [
              "number",
              "null"
            ]
          },
          "cashback_percent": {
            "type": [
              "number",
              "null"
            ]
          },
          "welcome_bonus": {
            "type": "number"
          },
          "birthday_bonus": {
            "type": "number"
          },
          "referrals_enabled": {
            "type": "boolean"
          },
          "referrer_bonus": {
            "type": "number"
          },
          "referred_bonus": {
            "type": "number"
          },
          "expiration_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "min_redeem_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "membership_uses": {
            "type": [
              "number",
              "null"
            ]
          },
          "membership_validity_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "gift_card_default_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "tiers_enabled": {
            "type": "boolean"
          },
          "tier_basis": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "lifetime_points",
              "lifetime_spend",
              "visits"
            ]
          },
          "card_design": {
            "type": [
              "object",
              "null"
            ]
          },
          "locations": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object"
            }
          },
          "enrollment_settings": {
            "type": [
              "object",
              "null"
            ]
          },
          "terms": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10000
          },
          "public_enrollment_enabled": {
            "type": "boolean"
          },
          "apple_wallet_enabled": {
            "type": "boolean"
          },
          "google_wallet_enabled": {
            "type": "boolean"
          }
        }
      },
      "LoyaltyProgramsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "type": {
            "type": "string",
            "enum": [
              "stamps",
              "points",
              "cashback",
              "membership",
              "gift_card"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "paused",
              "archived"
            ]
          },
          "slug": {
            "type": "string",
            "maxLength": 80
          },
          "currency_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 8
          },
          "earn_rules": {
            "type": [
              "object",
              "null"
            ]
          },
          "stamps_required": {
            "type": [
              "number",
              "null"
            ]
          },
          "cashback_percent": {
            "type": [
              "number",
              "null"
            ]
          },
          "welcome_bonus": {
            "type": "number"
          },
          "birthday_bonus": {
            "type": "number"
          },
          "referrals_enabled": {
            "type": "boolean"
          },
          "referrer_bonus": {
            "type": "number"
          },
          "referred_bonus": {
            "type": "number"
          },
          "expiration_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "min_redeem_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "membership_uses": {
            "type": [
              "number",
              "null"
            ]
          },
          "membership_validity_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "gift_card_default_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "tiers_enabled": {
            "type": "boolean"
          },
          "tier_basis": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "lifetime_points",
              "lifetime_spend",
              "visits"
            ]
          },
          "card_design": {
            "type": [
              "object",
              "null"
            ]
          },
          "locations": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object"
            }
          },
          "enrollment_settings": {
            "type": [
              "object",
              "null"
            ]
          },
          "terms": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10000
          },
          "public_enrollment_enabled": {
            "type": "boolean"
          },
          "apple_wallet_enabled": {
            "type": "boolean"
          },
          "google_wallet_enabled": {
            "type": "boolean"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LoyaltyRedemptions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "program_id",
          "member_id",
          "code",
          "status"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "program_id": {
            "type": "number"
          },
          "member_id": {
            "type": "number"
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "reward_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "issued",
              "used",
              "cancelled",
              "expired"
            ]
          },
          "channel": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "staff",
              "public_page",
              "checkout",
              "ai_assistant",
              "api",
              "automation"
            ]
          },
          "order_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "transaction_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "code": {
            "type": "string"
          },
          "cost": {
            "type": "number"
          },
          "reward_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "reward_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "discount_value": {
            "type": [
              "number",
              "null"
            ]
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "used_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LoyaltyRedemptionsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "member_id"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "organization_id": {
            "type": "number"
          },
          "member_id": {
            "type": "number"
          },
          "reward_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "staff",
              "public_page",
              "checkout",
              "ai_assistant",
              "api",
              "automation"
            ]
          },
          "mark_used": {
            "type": "boolean"
          }
        }
      },
      "LoyaltyRedemptionsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "used",
              "cancelled"
            ]
          },
          "order_id": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "LoyaltyRewards": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "program_id",
          "name",
          "cost"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "program_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "cost": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "reward_type": {
            "type": "string",
            "enum": [
              "free_item",
              "discount_fixed",
              "discount_percent",
              "custom"
            ]
          },
          "discount_value": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "product_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "min_tier_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "stock": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "code_validity_days": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "sort_order": {
            "type": "number"
          },
          "redeemed_count": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LoyaltyRewardsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "program_id",
          "name",
          "cost"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "organization_id": {
            "type": "number"
          },
          "program_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "cost": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "reward_type": {
            "type": "string",
            "enum": [
              "free_item",
              "discount_fixed",
              "discount_percent",
              "custom"
            ]
          },
          "discount_value": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "product_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "min_tier_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "stock": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "code_validity_days": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "sort_order": {
            "type": "number"
          }
        }
      },
      "LoyaltyRewardsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "organization_id": {
            "type": "number"
          },
          "program_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "cost": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "reward_type": {
            "type": "string",
            "enum": [
              "free_item",
              "discount_fixed",
              "discount_percent",
              "custom"
            ]
          },
          "discount_value": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "product_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "min_tier_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "stock": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "code_validity_days": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "sort_order": {
            "type": "number"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LoyaltyTiers": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "program_id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "program_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "threshold": {
            "type": "number",
            "minimum": 0
          },
          "earn_multiplier": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "benefits": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 16
          },
          "sort_order": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LoyaltyTiersData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "program_id",
          "name"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "organization_id": {
            "type": "number"
          },
          "program_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "threshold": {
            "type": "number",
            "minimum": 0
          },
          "earn_multiplier": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "benefits": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 16
          },
          "sort_order": {
            "type": "number"
          }
        }
      },
      "LoyaltyTiersPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "organization_id": {
            "type": "number"
          },
          "program_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "threshold": {
            "type": "number",
            "minimum": 0
          },
          "earn_multiplier": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "benefits": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 16
          },
          "sort_order": {
            "type": "number"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LoyaltyTransactions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "program_id",
          "member_id",
          "type",
          "amount"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "program_id": {
            "type": "number"
          },
          "member_id": {
            "type": "number"
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "earn",
              "redeem",
              "adjust",
              "expire",
              "bonus",
              "referral",
              "reversal",
              "load",
              "use"
            ]
          },
          "amount": {
            "type": "number"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "balance_after": {
            "type": "number"
          },
          "remaining_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expired_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "source_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LoyaltyTransactionsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "member_id",
          "amount"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "organization_id": {
            "type": "number"
          },
          "member_id": {
            "type": "number"
          },
          "amount": {
            "type": "number"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          }
        }
      },
      "LoyaltyTransactionsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Organizations": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "wallet_balance": {
            "type": "number",
            "default": 0
          },
          "wallet_auto_recharge_enabled": {
            "type": "boolean",
            "default": false
          },
          "wallet_auto_recharge_minimum": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_max_per_day": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_max_per_30_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_disabled_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_webchat_enabled": {
            "type": "boolean",
            "default": false
          },
          "mcp_enabled": {
            "type": "boolean",
            "default": false
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "billing_interval": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "day",
              "week",
              "month",
              "year",
              null
            ]
          },
          "billing_interval_count": {
            "type": [
              "number",
              "null"
            ]
          },
          "subscription_plan_name": {
            "type": [
              "string",
              "null"
            ],
            "default": "Free"
          },
          "subscription_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "active",
              "canceled",
              "past_due",
              "trialing",
              "incomplete",
              "incomplete_expired",
              null
            ]
          },
          "subscription_current_period_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_current_period_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_canceled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_cancel_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_cancel_at_period_end": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "timezone": {
            "type": "string",
            "default": "UTC"
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_locale": {
            "type": "string",
            "enum": [
              "en",
              "es"
            ],
            "default": "en"
          },
          "default_phone_country_iso": {
            "type": "string",
            "default": "US"
          },
          "default_phone_country_code": {
            "type": "string",
            "default": "+1"
          },
          "rate_limit_enabled": {
            "type": "boolean",
            "default": true
          },
          "rate_limit_max_requests": {
            "type": [
              "number",
              "null"
            ],
            "default": 1000
          },
          "rate_limit_window_seconds": {
            "type": [
              "number",
              "null"
            ],
            "default": 3600
          },
          "automation_limit_daily": {
            "type": [
              "number",
              "null"
            ]
          },
          "automation_limit_monthly": {
            "type": [
              "number",
              "null"
            ]
          },
          "automation_upgrade_needed_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "automation_upgrade_needed_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "daily_limit_reached",
              "monthly_limit_reached",
              null
            ]
          }
        }
      },
      "OrganizationsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "wallet_balance": {
            "type": "number",
            "default": 0
          },
          "wallet_auto_recharge_enabled": {
            "type": "boolean",
            "default": false
          },
          "wallet_auto_recharge_minimum": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_max_per_day": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_max_per_30_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_disabled_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_webchat_enabled": {
            "type": "boolean",
            "default": false
          },
          "mcp_enabled": {
            "type": "boolean",
            "default": false
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "billing_interval": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "day",
              "week",
              "month",
              "year",
              null
            ]
          },
          "billing_interval_count": {
            "type": [
              "number",
              "null"
            ]
          },
          "subscription_plan_name": {
            "type": [
              "string",
              "null"
            ],
            "default": "Free"
          },
          "subscription_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "active",
              "canceled",
              "past_due",
              "trialing",
              "incomplete",
              "incomplete_expired",
              null
            ]
          },
          "subscription_current_period_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_current_period_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_canceled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_cancel_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_cancel_at_period_end": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "timezone": {
            "type": "string",
            "default": "UTC"
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_locale": {
            "type": "string",
            "enum": [
              "en",
              "es"
            ],
            "default": "en"
          },
          "default_phone_country_iso": {
            "type": "string",
            "default": "US"
          },
          "default_phone_country_code": {
            "type": "string",
            "default": "+1"
          },
          "rate_limit_enabled": {
            "type": "boolean",
            "default": true
          },
          "rate_limit_max_requests": {
            "type": [
              "number",
              "null"
            ],
            "default": 1000
          },
          "rate_limit_window_seconds": {
            "type": [
              "number",
              "null"
            ],
            "default": 3600
          },
          "automation_limit_daily": {
            "type": [
              "number",
              "null"
            ]
          },
          "automation_limit_monthly": {
            "type": [
              "number",
              "null"
            ]
          },
          "automation_upgrade_needed_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "automation_upgrade_needed_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "daily_limit_reached",
              "monthly_limit_reached",
              null
            ]
          }
        }
      },
      "OrganizationsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "wallet_balance": {
            "type": "number",
            "default": 0
          },
          "wallet_auto_recharge_enabled": {
            "type": "boolean",
            "default": false
          },
          "wallet_auto_recharge_minimum": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_max_per_day": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_max_per_30_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "wallet_auto_recharge_disabled_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_webchat_enabled": {
            "type": "boolean",
            "default": false
          },
          "mcp_enabled": {
            "type": "boolean",
            "default": false
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "billing_interval": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "day",
              "week",
              "month",
              "year",
              null
            ]
          },
          "billing_interval_count": {
            "type": [
              "number",
              "null"
            ]
          },
          "subscription_plan_name": {
            "type": [
              "string",
              "null"
            ],
            "default": "Free"
          },
          "subscription_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "active",
              "canceled",
              "past_due",
              "trialing",
              "incomplete",
              "incomplete_expired",
              null
            ]
          },
          "subscription_current_period_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_current_period_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_canceled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_cancel_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "subscription_cancel_at_period_end": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "timezone": {
            "type": "string",
            "default": "UTC"
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "default_locale": {
            "type": "string",
            "enum": [
              "en",
              "es"
            ],
            "default": "en"
          },
          "default_phone_country_iso": {
            "type": "string",
            "default": "US"
          },
          "default_phone_country_code": {
            "type": "string",
            "default": "+1"
          },
          "rate_limit_enabled": {
            "type": "boolean",
            "default": true
          },
          "rate_limit_max_requests": {
            "type": [
              "number",
              "null"
            ],
            "default": 1000
          },
          "rate_limit_window_seconds": {
            "type": [
              "number",
              "null"
            ],
            "default": 3600
          },
          "automation_limit_daily": {
            "type": [
              "number",
              "null"
            ]
          },
          "automation_limit_monthly": {
            "type": [
              "number",
              "null"
            ]
          },
          "automation_upgrade_needed_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "automation_upgrade_needed_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "daily_limit_reached",
              "monthly_limit_reached",
              null
            ]
          }
        }
      },
      "OrganizationsUsersInvites": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "email",
          "created_by_user_id",
          "role",
          "status",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "member"
            ]
          },
          "organization_role_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "rejected"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "OrganizationsUsersInvitesData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "organization_id",
          "role",
          "status",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "member"
            ]
          },
          "organization_role_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "rejected"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "OrganizationsUsersInvitesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "member"
            ]
          },
          "organization_role_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "rejected"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PipelineStages": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "pipeline_id",
          "organization_id",
          "order"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "pipeline_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "order": {
            "type": "number"
          },
          "rotting_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PipelineStagesData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "pipeline_id",
          "organization_id",
          "order"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "pipeline_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "order": {
            "type": "number"
          },
          "rotting_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PipelineStagesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "pipeline_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "order": {
            "type": "number"
          },
          "rotting_days": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Pipelines": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "deal",
              "ticket",
              "conversation"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "config": {
            "type": [
              "object",
              "null"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PipelinesData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "organization_id",
          "type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "deal",
              "ticket",
              "conversation"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "config": {
            "type": [
              "object",
              "null"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PipelinesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "deal",
              "ticket",
              "conversation"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "created_by_user_id": {
            "type": "number"
          },
          "config": {
            "type": [
              "object",
              "null"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Products": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "organization_id",
          "type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "parent_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "product_category_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "price": {
            "type": "number",
            "minimum": 0
          },
          "system_currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "track_inventory": {
            "type": "boolean",
            "default": false
          },
          "allow_backorder": {
            "type": "boolean",
            "default": false
          },
          "billing_type": {
            "type": "string",
            "enum": [
              "one_time",
              "recurring"
            ],
            "default": "one_time"
          },
          "billing_interval": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string",
                "enum": [
                  "day",
                  "week",
                  "month",
                  "quarter",
                  "year",
                  "custom"
                ]
              }
            ]
          },
          "billing_interval_count": {
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ],
            "default": "active"
          },
          "type": {
            "type": "string",
            "enum": [
              "product",
              "service"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "stock_quantity": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "is_variant": {
            "type": "boolean",
            "default": false
          },
          "meta_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "is_embeddable": {
            "type": "boolean",
            "default": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "last_updated": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              }
            }
          }
        }
      },
      "ProductsData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "organization_id",
          "type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "parent_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "product_category_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "price": {
            "type": "number",
            "minimum": 0
          },
          "system_currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "track_inventory": {
            "type": "boolean",
            "default": false
          },
          "allow_backorder": {
            "type": "boolean",
            "default": false
          },
          "billing_type": {
            "type": "string",
            "enum": [
              "one_time",
              "recurring"
            ],
            "default": "one_time"
          },
          "billing_interval": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string",
                "enum": [
                  "day",
                  "week",
                  "month",
                  "quarter",
                  "year",
                  "custom"
                ]
              }
            ]
          },
          "billing_interval_count": {
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ],
            "default": "active"
          },
          "type": {
            "type": "string",
            "enum": [
              "product",
              "service"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "stock_quantity": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "is_variant": {
            "type": "boolean",
            "default": false
          },
          "meta_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "is_embeddable": {
            "type": "boolean",
            "default": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "last_updated": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              }
            }
          }
        }
      },
      "ProductsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "parent_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "product_category_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_id": {
            "type": "number"
          },
          "price": {
            "type": "number",
            "minimum": 0
          },
          "system_currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "track_inventory": {
            "type": "boolean",
            "default": false
          },
          "allow_backorder": {
            "type": "boolean",
            "default": false
          },
          "billing_type": {
            "type": "string",
            "enum": [
              "one_time",
              "recurring"
            ],
            "default": "one_time"
          },
          "billing_interval": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string",
                "enum": [
                  "day",
                  "week",
                  "month",
                  "quarter",
                  "year",
                  "custom"
                ]
              }
            ]
          },
          "billing_interval_count": {
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ],
            "default": "active"
          },
          "type": {
            "type": "string",
            "enum": [
              "product",
              "service"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "stock_quantity": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "is_variant": {
            "type": "boolean",
            "default": false
          },
          "meta_data": {
            "type": [
              "object",
              "null"
            ]
          },
          "is_embeddable": {
            "type": "boolean",
            "default": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "last_updated": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              }
            }
          }
        }
      },
      "ProductsCategories": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "organization_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ProductsCategoriesData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "organization_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ProductsCategoriesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "organization_id": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ProductsMedia": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "product_id",
          "file_name",
          "file_type",
          "file_path",
          "s3_key",
          "s3_path"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "product_id": {
            "type": "number"
          },
          "position": {
            "type": "integer",
            "default": 0
          },
          "file_name": {
            "type": "string"
          },
          "file_type": {
            "type": "string"
          },
          "file_size": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "file_path": {
            "type": "string"
          },
          "s3_key": {
            "type": "string"
          },
          "s3_path": {
            "type": "string"
          }
        }
      },
      "ProductsMediaData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "product_id": {
            "type": "number"
          },
          "position": {
            "type": "integer",
            "default": 0
          },
          "file_name": {
            "type": "string"
          },
          "file_type": {
            "type": "string"
          },
          "file_size": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "file_path": {
            "type": "string"
          },
          "s3_key": {
            "type": "string"
          },
          "s3_path": {
            "type": "string"
          }
        }
      },
      "ProductsMediaPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "product_id": {
            "type": "number"
          },
          "position": {
            "type": "integer",
            "default": 0
          },
          "file_name": {
            "type": "string"
          },
          "file_type": {
            "type": "string"
          },
          "file_size": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "file_path": {
            "type": "string"
          },
          "s3_key": {
            "type": "string"
          },
          "s3_path": {
            "type": "string"
          }
        }
      },
      "ReservationBookingLinks": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "name",
          "slug",
          "mode"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "slug": {
            "type": "string",
            "maxLength": 255
          },
          "mode": {
            "type": "string",
            "enum": [
              "all_services",
              "single_service",
              "selected_services"
            ],
            "default": "all_services"
          },
          "service_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "page_config": {
            "type": "object",
            "additionalProperties": true
          },
          "settings": {
            "type": "object",
            "additionalProperties": true
          },
          "tracking_config": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "meta_pixel_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ga4_measurement_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "custom_head_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "custom_body_code": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationBookingLinksData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "organization_id",
          "name",
          "mode"
        ],
        "properties": {
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "slug": {
            "type": "string",
            "maxLength": 255
          },
          "mode": {
            "type": "string",
            "enum": [
              "all_services",
              "single_service",
              "selected_services"
            ],
            "default": "all_services"
          },
          "service_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "page_config": {
            "type": "object",
            "additionalProperties": true
          },
          "settings": {
            "type": "object",
            "additionalProperties": true
          },
          "tracking_config": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "meta_pixel_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ga4_measurement_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "custom_head_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "custom_body_code": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "ReservationBookingLinksPatch": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "slug": {
            "type": "string",
            "maxLength": 255
          },
          "mode": {
            "type": "string",
            "enum": [
              "all_services",
              "single_service",
              "selected_services"
            ],
            "default": "all_services"
          },
          "service_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "page_config": {
            "type": "object",
            "additionalProperties": true
          },
          "settings": {
            "type": "object",
            "additionalProperties": true
          },
          "tracking_config": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "meta_pixel_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ga4_measurement_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "custom_head_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "custom_body_code": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationResourceAvailability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "resource_id",
          "day_of_week",
          "start_time",
          "end_time"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "resource_id": {
            "type": "number"
          },
          "day_of_week": {
            "type": "number",
            "minimum": 0,
            "maximum": 6
          },
          "start_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
          },
          "end_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
          },
          "breaks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "start_time": {
                  "type": "string"
                },
                "end_time": {
                  "type": "string"
                }
              },
              "required": [
                "start_time",
                "end_time"
              ]
            },
            "default": []
          },
          "valid_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationResourceAvailabilityData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "organization_id",
          "resource_id",
          "day_of_week",
          "start_time",
          "end_time"
        ],
        "properties": {
          "organization_id": {
            "type": "number"
          },
          "resource_id": {
            "type": "number"
          },
          "day_of_week": {
            "type": "number",
            "minimum": 0,
            "maximum": 6
          },
          "start_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
          },
          "end_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
          },
          "breaks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "start_time": {
                  "type": "string"
                },
                "end_time": {
                  "type": "string"
                }
              },
              "required": [
                "start_time",
                "end_time"
              ]
            },
            "default": []
          },
          "valid_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "is_active": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "ReservationResourceAvailabilityPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "resource_id": {
            "type": "number"
          },
          "day_of_week": {
            "type": "number",
            "minimum": 0,
            "maximum": 6
          },
          "start_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
          },
          "end_time": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
          },
          "breaks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "start_time": {
                  "type": "string"
                },
                "end_time": {
                  "type": "string"
                }
              },
              "required": [
                "start_time",
                "end_time"
              ]
            },
            "default": []
          },
          "valid_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationResourceExceptions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "exception_type",
          "date"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "resource_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "exception_type": {
            "type": "string",
            "enum": [
              "blocked",
              "special_hours",
              "holiday"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "start_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "end_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "is_recurring_yearly": {
            "type": "boolean",
            "default": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationResourceExceptionsData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "organization_id",
          "exception_type",
          "date"
        ],
        "properties": {
          "organization_id": {
            "type": "number"
          },
          "resource_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "exception_type": {
            "type": "string",
            "enum": [
              "blocked",
              "special_hours",
              "holiday"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "start_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "end_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "is_recurring_yearly": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ReservationResourceExceptionsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "resource_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "exception_type": {
            "type": "string",
            "enum": [
              "blocked",
              "special_hours",
              "holiday"
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "start_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "end_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "is_recurring_yearly": {
            "type": "boolean",
            "default": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationResources": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "resource_type",
          "name"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "resource_type": {
            "type": "string",
            "enum": [
              "person",
              "room",
              "equipment",
              "vehicle",
              "other"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "capacity": {
            "type": "number",
            "default": 1
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationResourcesData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "organization_id",
          "resource_type",
          "name"
        ],
        "properties": {
          "organization_id": {
            "type": "number"
          },
          "resource_type": {
            "type": "string",
            "enum": [
              "person",
              "room",
              "equipment",
              "vehicle",
              "other"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "capacity": {
            "type": "number",
            "default": 1
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "is_active": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "ReservationResourcesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "resource_type": {
            "type": "string",
            "enum": [
              "person",
              "room",
              "equipment",
              "vehicle",
              "other"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "capacity": {
            "type": "number",
            "default": 1
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationServiceResources": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "service_id",
          "resource_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "service_id": {
            "type": "number"
          },
          "resource_id": {
            "type": "number"
          },
          "assignment_mode": {
            "type": "string",
            "enum": [
              "required",
              "optional",
              "any_available"
            ],
            "default": "required"
          },
          "quantity_required": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "priority": {
            "type": "number",
            "default": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationServiceResourcesData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "organization_id",
          "service_id",
          "resource_id"
        ],
        "properties": {
          "organization_id": {
            "type": "number"
          },
          "service_id": {
            "type": "number"
          },
          "resource_id": {
            "type": "number"
          },
          "assignment_mode": {
            "type": "string",
            "enum": [
              "required",
              "optional",
              "any_available"
            ],
            "default": "required"
          },
          "quantity_required": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "priority": {
            "type": "number",
            "default": 0
          }
        }
      },
      "ReservationServiceResourcesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "service_id": {
            "type": "number"
          },
          "resource_id": {
            "type": "number"
          },
          "assignment_mode": {
            "type": "string",
            "enum": [
              "required",
              "optional",
              "any_available"
            ],
            "default": "required"
          },
          "quantity_required": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "priority": {
            "type": "number",
            "default": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationServices": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "name",
          "duration_minutes"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_minutes": {
            "type": "number",
            "minimum": 1
          },
          "buffer_before_minutes": {
            "type": "number",
            "default": 0
          },
          "buffer_after_minutes": {
            "type": "number",
            "default": 0
          },
          "slot_capacity": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "max_party_size": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "capacity_mode": {
            "type": "string",
            "enum": [
              "per_slot",
              "per_resource"
            ],
            "default": "per_slot"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency_symbol": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency_format": {
            "type": [
              "string",
              "null"
            ]
          },
          "decimal_places": {
            "type": [
              "number",
              "null"
            ],
            "default": 2
          },
          "thousand_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": ","
          },
          "decimal_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": "."
          },
          "max_daily_bookings": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1
          },
          "max_advance_days": {
            "type": "number",
            "default": 30,
            "minimum": 1
          },
          "min_advance_hours": {
            "type": "number",
            "default": 1,
            "minimum": 0
          },
          "requires_confirmation": {
            "type": "boolean",
            "default": false
          },
          "auto_confirm": {
            "type": "boolean",
            "default": true
          },
          "allow_cancellation": {
            "type": "boolean",
            "default": true
          },
          "cancellation_deadline_hours": {
            "type": "number",
            "default": 24,
            "minimum": 0
          },
          "is_public": {
            "type": "boolean",
            "default": true
          },
          "booking_instructions": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "product_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "default": "UTC"
          },
          "slot_interval": {
            "type": "number",
            "default": 30,
            "minimum": 5
          },
          "duration_mode": {
            "type": "string",
            "enum": [
              "fixed",
              "flexible"
            ],
            "default": "fixed"
          },
          "duration_options": {
            "type": "array",
            "items": {
              "type": "number",
              "minimum": 5,
              "maximum": 10080
            },
            "maxItems": 24,
            "default": []
          },
          "capacity_unit": {
            "type": "string",
            "enum": [
              "bookings",
              "people"
            ],
            "default": "bookings"
          },
          "min_party_size": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "pricing_unit": {
            "type": "string",
            "enum": [
              "per_booking",
              "per_person",
              "per_hour"
            ],
            "default": "per_booking"
          },
          "payment_mode": {
            "type": "string",
            "enum": [
              "none",
              "optional",
              "deposit",
              "full"
            ],
            "default": "none"
          },
          "deposit_type": {
            "type": "string",
            "enum": [
              "percent",
              "fixed"
            ],
            "default": "percent"
          },
          "deposit_value": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "payment_hold_minutes": {
            "type": "number",
            "default": 30,
            "minimum": 5,
            "maximum": 10080
          },
          "payment_gateway_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "allow_customer_reschedule": {
            "type": "boolean",
            "default": false
          },
          "reschedule_deadline_hours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "cancellation_policy_text": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ReservationServicesData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "organization_id",
          "name",
          "duration_minutes"
        ],
        "properties": {
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_minutes": {
            "type": "number",
            "minimum": 1
          },
          "buffer_before_minutes": {
            "type": "number",
            "default": 0
          },
          "buffer_after_minutes": {
            "type": "number",
            "default": 0
          },
          "slot_capacity": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "max_party_size": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "capacity_mode": {
            "type": "string",
            "enum": [
              "per_slot",
              "per_resource"
            ],
            "default": "per_slot"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency_symbol": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency_format": {
            "type": [
              "string",
              "null"
            ]
          },
          "decimal_places": {
            "type": [
              "number",
              "null"
            ],
            "default": 2
          },
          "thousand_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": ","
          },
          "decimal_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": "."
          },
          "max_daily_bookings": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1
          },
          "max_advance_days": {
            "type": "number",
            "default": 30,
            "minimum": 1
          },
          "min_advance_hours": {
            "type": "number",
            "default": 1,
            "minimum": 0
          },
          "requires_confirmation": {
            "type": "boolean",
            "default": false
          },
          "auto_confirm": {
            "type": "boolean",
            "default": true
          },
          "allow_cancellation": {
            "type": "boolean",
            "default": true
          },
          "cancellation_deadline_hours": {
            "type": "number",
            "default": 24,
            "minimum": 0
          },
          "is_public": {
            "type": "boolean",
            "default": true
          },
          "booking_instructions": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "product_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "default": "UTC"
          },
          "slot_interval": {
            "type": "number",
            "default": 30,
            "minimum": 5
          },
          "duration_mode": {
            "type": "string",
            "enum": [
              "fixed",
              "flexible"
            ],
            "default": "fixed"
          },
          "duration_options": {
            "type": "array",
            "items": {
              "type": "number",
              "minimum": 5,
              "maximum": 10080
            },
            "maxItems": 24,
            "default": []
          },
          "capacity_unit": {
            "type": "string",
            "enum": [
              "bookings",
              "people"
            ],
            "default": "bookings"
          },
          "min_party_size": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "pricing_unit": {
            "type": "string",
            "enum": [
              "per_booking",
              "per_person",
              "per_hour"
            ],
            "default": "per_booking"
          },
          "payment_mode": {
            "type": "string",
            "enum": [
              "none",
              "optional",
              "deposit",
              "full"
            ],
            "default": "none"
          },
          "deposit_type": {
            "type": "string",
            "enum": [
              "percent",
              "fixed"
            ],
            "default": "percent"
          },
          "deposit_value": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "payment_hold_minutes": {
            "type": "number",
            "default": 30,
            "minimum": 5,
            "maximum": 10080
          },
          "payment_gateway_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "allow_customer_reschedule": {
            "type": "boolean",
            "default": false
          },
          "reschedule_deadline_hours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "cancellation_policy_text": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          }
        }
      },
      "ReservationServicesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_minutes": {
            "type": "number",
            "minimum": 1
          },
          "buffer_before_minutes": {
            "type": "number",
            "default": 0
          },
          "buffer_after_minutes": {
            "type": "number",
            "default": 0
          },
          "slot_capacity": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "max_party_size": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "capacity_mode": {
            "type": "string",
            "enum": [
              "per_slot",
              "per_resource"
            ],
            "default": "per_slot"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "exchange_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency_symbol": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency_format": {
            "type": [
              "string",
              "null"
            ]
          },
          "decimal_places": {
            "type": [
              "number",
              "null"
            ],
            "default": 2
          },
          "thousand_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": ","
          },
          "decimal_separator": {
            "type": [
              "string",
              "null"
            ],
            "default": "."
          },
          "max_daily_bookings": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1
          },
          "max_advance_days": {
            "type": "number",
            "default": 30,
            "minimum": 1
          },
          "min_advance_hours": {
            "type": "number",
            "default": 1,
            "minimum": 0
          },
          "requires_confirmation": {
            "type": "boolean",
            "default": false
          },
          "auto_confirm": {
            "type": "boolean",
            "default": true
          },
          "allow_cancellation": {
            "type": "boolean",
            "default": true
          },
          "cancellation_deadline_hours": {
            "type": "number",
            "default": 24,
            "minimum": 0
          },
          "is_public": {
            "type": "boolean",
            "default": true
          },
          "booking_instructions": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "product_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "default": "UTC"
          },
          "slot_interval": {
            "type": "number",
            "default": 30,
            "minimum": 5
          },
          "duration_mode": {
            "type": "string",
            "enum": [
              "fixed",
              "flexible"
            ],
            "default": "fixed"
          },
          "duration_options": {
            "type": "array",
            "items": {
              "type": "number",
              "minimum": 5,
              "maximum": 10080
            },
            "maxItems": 24,
            "default": []
          },
          "capacity_unit": {
            "type": "string",
            "enum": [
              "bookings",
              "people"
            ],
            "default": "bookings"
          },
          "min_party_size": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "pricing_unit": {
            "type": "string",
            "enum": [
              "per_booking",
              "per_person",
              "per_hour"
            ],
            "default": "per_booking"
          },
          "payment_mode": {
            "type": "string",
            "enum": [
              "none",
              "optional",
              "deposit",
              "full"
            ],
            "default": "none"
          },
          "deposit_type": {
            "type": "string",
            "enum": [
              "percent",
              "fixed"
            ],
            "default": "percent"
          },
          "deposit_value": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "payment_hold_minutes": {
            "type": "number",
            "default": 30,
            "minimum": 5,
            "maximum": 10080
          },
          "payment_gateway_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "allow_customer_reschedule": {
            "type": "boolean",
            "default": false
          },
          "reschedule_deadline_hours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "cancellation_policy_text": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Reservations": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id",
          "service_id",
          "contact_id",
          "start_datetime",
          "end_datetime"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "service_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "party_size": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "start_datetime": {
            "type": "string",
            "format": "date-time"
          },
          "end_datetime": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "awaiting_payment",
              "cancelled",
              "completed",
              "no_show"
            ],
            "default": "pending"
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "whatsapp_ai",
              "instagram_ai",
              "webchat",
              "public_link",
              "api",
              "automation"
            ],
            "default": "manual"
          },
          "conversation_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "deal_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "estimate_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "invoice_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "google_meet_link": {
            "type": [
              "string",
              "null"
            ]
          },
          "confirmation_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reminders_sent": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancelled_by": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "customer",
              "organization",
              "system"
            ]
          },
          "cancellation_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "internal_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "none",
              "not_required",
              "pending",
              "deposit_paid",
              "paid",
              "partially_refunded",
              "refunded",
              "expired"
            ],
            "default": "none"
          },
          "duration_minutes": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1
          },
          "amount_total": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "amount_due_now": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "amount_paid": {
            "type": "number",
            "minimum": 0,
            "default": 0
          },
          "system_currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "payment_choice": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pay_now",
              "pay_later",
              null
            ]
          },
          "payment_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "payment_link_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "needs_refund": {
            "type": "boolean",
            "default": false
          },
          "refunded_amount": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "refunded_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "payment_amount": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "preferred_resource_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "ReservationsData": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "organization_id",
          "service_id",
          "contact_id",
          "start_datetime"
        ],
        "properties": {
          "organization_id": {
            "type": "number"
          },
          "service_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "party_size": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "start_datetime": {
            "type": "string",
            "format": "date-time"
          },
          "end_datetime": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "awaiting_payment",
              "cancelled",
              "completed",
              "no_show"
            ],
            "default": "pending"
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "whatsapp_ai",
              "instagram_ai",
              "webchat",
              "public_link",
              "api",
              "automation"
            ],
            "default": "manual"
          },
          "conversation_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "deal_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "estimate_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "invoice_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "google_meet_link": {
            "type": [
              "string",
              "null"
            ]
          },
          "confirmation_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reminders_sent": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancelled_by": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "customer",
              "organization",
              "system"
            ]
          },
          "cancellation_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "internal_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "none",
              "not_required",
              "pending",
              "deposit_paid",
              "paid",
              "partially_refunded",
              "refunded",
              "expired"
            ],
            "default": "none"
          },
          "duration_minutes": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1
          },
          "amount_total": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "amount_due_now": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "amount_paid": {
            "type": "number",
            "minimum": 0,
            "default": 0
          },
          "system_currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "payment_choice": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pay_now",
              "pay_later",
              null
            ]
          },
          "payment_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "payment_link_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "needs_refund": {
            "type": "boolean",
            "default": false
          },
          "refunded_amount": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "refunded_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "payment_amount": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "preferred_resource_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "ReservationsPatch": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "service_id": {
            "type": "number"
          },
          "contact_id": {
            "type": "number"
          },
          "party_size": {
            "type": "number",
            "default": 1,
            "minimum": 1
          },
          "start_datetime": {
            "type": "string",
            "format": "date-time"
          },
          "end_datetime": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "awaiting_payment",
              "cancelled",
              "completed",
              "no_show"
            ],
            "default": "pending"
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "whatsapp_ai",
              "instagram_ai",
              "webchat",
              "public_link",
              "api",
              "automation"
            ],
            "default": "manual"
          },
          "conversation_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "deal_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "company_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "estimate_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "invoice_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "google_meet_link": {
            "type": [
              "string",
              "null"
            ]
          },
          "confirmation_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reminders_sent": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancelled_by": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "customer",
              "organization",
              "system"
            ]
          },
          "cancellation_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "internal_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "none",
              "not_required",
              "pending",
              "deposit_paid",
              "paid",
              "partially_refunded",
              "refunded",
              "expired"
            ],
            "default": "none"
          },
          "duration_minutes": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1
          },
          "amount_total": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "amount_due_now": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "amount_paid": {
            "type": "number",
            "minimum": 0,
            "default": 0
          },
          "system_currency_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "payment_choice": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pay_now",
              "pay_later",
              null
            ]
          },
          "payment_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "payment_link_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "needs_refund": {
            "type": "boolean",
            "default": false
          },
          "refunded_amount": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "refunded_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "payment_amount": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "preferred_resource_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "created_by_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_meta_data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "custom_field_id",
                "custom_field_name",
                "custom_field_value"
              ],
              "properties": {
                "custom_field_id": {
                  "type": [
                    "number"
                  ]
                },
                "custom_field_key": {
                  "type": "string"
                },
                "custom_field_name": {
                  "type": "string"
                },
                "custom_field_value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "array"
                    },
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "S3UrlSigning": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "filename"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "entity_type": {
            "type": "string"
          },
          "entity_id": {
            "type": "number"
          },
          "field_key": {
            "type": "string"
          },
          "contact_id": {
            "type": "number"
          },
          "company_id": {
            "type": "number"
          },
          "conversation_id": {
            "type": "number"
          },
          "automation_id": {
            "type": "number"
          },
          "deal_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "ticket_id": {
            "type": "number"
          },
          "product_id": {
            "type": "number"
          },
          "estimate_id": {
            "type": "number"
          },
          "invoice_id": {
            "type": "number"
          },
          "contract_id": {
            "type": "number"
          },
          "deleted_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "file_size": {
            "type": "number"
          }
        }
      },
      "S3UrlSigningData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "filename"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "entity_type": {
            "type": "string"
          },
          "entity_id": {
            "type": "number"
          },
          "field_key": {
            "type": "string"
          },
          "contact_id": {
            "type": "number"
          },
          "company_id": {
            "type": "number"
          },
          "conversation_id": {
            "type": "number"
          },
          "automation_id": {
            "type": "number"
          },
          "deal_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "ticket_id": {
            "type": "number"
          },
          "product_id": {
            "type": "number"
          },
          "estimate_id": {
            "type": "number"
          },
          "invoice_id": {
            "type": "number"
          },
          "contract_id": {
            "type": "number"
          },
          "deleted_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "file_size": {
            "type": "number"
          }
        }
      },
      "S3UrlSigningPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "entity_type": {
            "type": "string"
          },
          "entity_id": {
            "type": "number"
          },
          "field_key": {
            "type": "string"
          },
          "contact_id": {
            "type": "number"
          },
          "company_id": {
            "type": "number"
          },
          "conversation_id": {
            "type": "number"
          },
          "automation_id": {
            "type": "number"
          },
          "deal_id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "ticket_id": {
            "type": "number"
          },
          "product_id": {
            "type": "number"
          },
          "estimate_id": {
            "type": "number"
          },
          "invoice_id": {
            "type": "number"
          },
          "contract_id": {
            "type": "number"
          },
          "deleted_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "file_size": {
            "type": "number"
          }
        }
      },
      "SupportTickets": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "inbox_channel_id": {
            "type": "number"
          },
          "meta_inbox_channel_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "gmail",
              "outlook"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_contact_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "pending",
              "closed",
              "done",
              "waiting_customer"
            ],
            "default": "open"
          },
          "priority": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "urgent"
            ],
            "default": "medium"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": "string"
                }
              }
            },
            "default": []
          },
          "assigned_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "thread_id": {
            "type": "string"
          },
          "last_message_at": {
            "type": "string",
            "format": "date-time"
          },
          "handoff_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "unread_count": {
            "type": "number",
            "default": 0
          },
          "is_unread": {
            "type": "boolean",
            "default": false
          },
          "last_message_received": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_sent": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_system": {
            "type": "string",
            "format": "date-time"
          },
          "next_follow_up_rule_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_follow_up_date_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "follow_up_count": {
            "type": "number",
            "default": 0
          },
          "pipeline_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "pipeline_stage_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "conversation_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "conversation_summary_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SupportTicketsData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "inbox_channel_id": {
            "type": "number"
          },
          "meta_inbox_channel_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "gmail",
              "outlook"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_contact_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "pending",
              "closed",
              "done",
              "waiting_customer"
            ],
            "default": "open"
          },
          "priority": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "urgent"
            ],
            "default": "medium"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": "string"
                }
              }
            },
            "default": []
          },
          "assigned_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "thread_id": {
            "type": "string"
          },
          "last_message_at": {
            "type": "string",
            "format": "date-time"
          },
          "handoff_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "unread_count": {
            "type": "number",
            "default": 0
          },
          "is_unread": {
            "type": "boolean",
            "default": false
          },
          "last_message_received": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_sent": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_system": {
            "type": "string",
            "format": "date-time"
          },
          "next_follow_up_rule_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_follow_up_date_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "follow_up_count": {
            "type": "number",
            "default": 0
          },
          "pipeline_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "pipeline_stage_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "conversation_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "conversation_summary_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SupportTicketsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "inbox_channel_id": {
            "type": "number"
          },
          "meta_inbox_channel_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "gmail",
              "outlook"
            ]
          },
          "contact_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta_contact_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_contact_last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "pending",
              "closed",
              "done",
              "waiting_customer"
            ],
            "default": "open"
          },
          "priority": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "urgent"
            ],
            "default": "medium"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": "string"
                }
              }
            },
            "default": []
          },
          "assigned_user_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "assigned_ai_assistant_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "thread_id": {
            "type": "string"
          },
          "last_message_at": {
            "type": "string",
            "format": "date-time"
          },
          "handoff_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "unread_count": {
            "type": "number",
            "default": 0
          },
          "is_unread": {
            "type": "boolean",
            "default": false
          },
          "last_message_received": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_sent": {
            "type": "string",
            "format": "date-time"
          },
          "last_message_system": {
            "type": "string",
            "format": "date-time"
          },
          "next_follow_up_rule_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_follow_up_date_time": {
            "type": [
              "string",
              "null"
            ]
          },
          "follow_up_count": {
            "type": "number",
            "default": 0
          },
          "pipeline_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "pipeline_stage_id": {
            "type": [
              "number",
              "null"
            ]
          },
          "custom_fields_by_name": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "custom_fields_by_key": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array"
                },
                {
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "conversation_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "conversation_summary_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "WhatsappChannelMessageTemplates": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "language",
          "category"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "whatsapp_channel_id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "whatsapp_template_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "AUTHENTICATION",
              "MARKETING",
              "UTILITY"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "APPROVED",
              "PENDING",
              "REJECTED"
            ]
          },
          "meta_status_update": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "components": {
            "type": "array"
          },
          "variables_matching": {
            "type": [
              "object",
              "null"
            ]
          },
          "available_for_conversations": {
            "type": "boolean"
          },
          "available_for_campaigns": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "WhatsappChannelMessageTemplatesData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organization_id",
          "whatsapp_channel_id",
          "name",
          "language",
          "category"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "whatsapp_channel_id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "whatsapp_template_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "AUTHENTICATION",
              "MARKETING",
              "UTILITY"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "APPROVED",
              "PENDING",
              "REJECTED"
            ]
          },
          "meta_status_update": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "components": {
            "type": "array"
          },
          "variables_matching": {
            "type": [
              "object",
              "null"
            ]
          },
          "available_for_conversations": {
            "type": "boolean"
          },
          "available_for_campaigns": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "WhatsappChannelMessageTemplatesPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "whatsapp_channel_id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "whatsapp_template_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "AUTHENTICATION",
              "MARKETING",
              "UTILITY"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "APPROVED",
              "PENDING",
              "REJECTED"
            ]
          },
          "meta_status_update": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "components": {
            "type": "array"
          },
          "variables_matching": {
            "type": [
              "object",
              "null"
            ]
          },
          "available_for_conversations": {
            "type": "boolean"
          },
          "available_for_campaigns": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "WhatsappChannels": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "organization_id"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "inactive"
            ]
          },
          "wa_ba_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "wa_phone_number_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "display_phone_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality_rating": {
            "type": [
              "string",
              "null"
            ]
          },
          "verified_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "code_verification_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_timezone": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_verification_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_template_namespace": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_verification_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "can_send_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_number_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "whatsapp_business_manager_messaging_limit": {
            "type": [
              "string",
              "null"
            ]
          },
          "throughput_level": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_quality_score": {
            "type": [
              "string",
              "null"
            ]
          },
          "registration_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "wa_name_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "webhook_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_business_app_onboarding": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "is_default": {
            "type": "boolean"
          }
        }
      },
      "WhatsappChannelsData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "inactive"
            ]
          },
          "wa_ba_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "wa_phone_number_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "display_phone_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality_rating": {
            "type": [
              "string",
              "null"
            ]
          },
          "verified_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "code_verification_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_timezone": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_verification_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_template_namespace": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_verification_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "can_send_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_number_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "whatsapp_business_manager_messaging_limit": {
            "type": [
              "string",
              "null"
            ]
          },
          "throughput_level": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_quality_score": {
            "type": [
              "string",
              "null"
            ]
          },
          "registration_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "wa_name_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "webhook_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_business_app_onboarding": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "is_default": {
            "type": "boolean"
          }
        }
      },
      "WhatsappChannelsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "number"
          },
          "organization_id": {
            "type": "number"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "inactive"
            ]
          },
          "wa_ba_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "wa_phone_number_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "display_phone_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality_rating": {
            "type": [
              "string",
              "null"
            ]
          },
          "verified_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "code_verification_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_timezone": {
            "type": [
              "string",
              "null"
            ]
          },
          "waba_verification_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "message_template_namespace": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "business_verification_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "can_send_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_number_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "whatsapp_business_manager_messaging_limit": {
            "type": [
              "string",
              "null"
            ]
          },
          "throughput_level": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_quality_score": {
            "type": [
              "string",
              "null"
            ]
          },
          "registration_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "wa_name_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "webhook_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_business_app_onboarding": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "is_default": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
