{
  "openapi": "3.1.0",
  "info": {
    "title": "Ready API",
    "version": "1",
    "summary": "Send texts, manage numbers, registration, calls, sub-accounts and webhooks.",
    "description": "The public Ready REST API, /v1. JSON over HTTPS. Reference pages: https://docs.tryready.com/api. SDKs: https://docs.tryready.com/api/sdks.\n\nAuthentication: send your API key (it starts with rsms_, or rsms_test_ for a test key) as X-API-Key or as Authorization: Bearer.\n\nSub-accounts: an agency adds X-Sub-Account-Id to a /v1 request to run it as one of its sub-accounts.\n\nResponses: a success has \"success\": true and the result in data; lists put their paging fields next to data. An error has \"success\": false, a sentence in error and a stable code in error_code or code (read error_code ?? code). Every response carries X-Request-Id and X-API-Version.\n\nIdempotency: send an Idempotency-Key header on every send and purchase. A retry with the same key returns the first result instead of running again. Operations marked x-ready-idempotent honour it. The registration operations (brand, campaign, vet, confirm) dedupe on the server instead and ignore Idempotency-Key.\n\nVersioning: /v1 only grows. Pin it with Accept-Version: 1 (an unknown version answers 406). A removal gets at least 90 days of notice.\n\nBase URL: https://api.tryready.com. White label partners may serve the same API from their own host later; every SDK takes the base URL as an option.",
    "contact": {
      "name": "Ready support",
      "email": "help@tryready.com",
      "url": "https://docs.tryready.com"
    },
    "termsOfService": "https://tryready.com/terms"
  },
  "servers": [
    {
      "url": "https://api.tryready.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "API Keys"
    },
    {
      "name": "Account"
    },
    {
      "name": "Area codes"
    },
    {
      "name": "Call settings"
    },
    {
      "name": "Calls"
    },
    {
      "name": "Compliance"
    },
    {
      "name": "Media"
    },
    {
      "name": "Messages"
    },
    {
      "name": "Number health"
    },
    {
      "name": "Numbers"
    },
    {
      "name": "Opt-outs"
    },
    {
      "name": "Partner"
    },
    {
      "name": "Port requests"
    },
    {
      "name": "Registration"
    },
    {
      "name": "Reply Sorting"
    },
    {
      "name": "Reports"
    },
    {
      "name": "SIP trunk"
    },
    {
      "name": "Snapshots"
    },
    {
      "name": "Sub-accounts"
    },
    {
      "name": "Team Members"
    },
    {
      "name": "Validation"
    },
    {
      "name": "Voice messages"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "WhatsApp"
    },
    {
      "name": "White Label"
    },
    {
      "name": "iMessage lines"
    }
  ],
  "paths": {
    "/v1/account": {
      "get": {
        "operationId": "account.get",
        "tags": [
          "Account"
        ],
        "summary": "Get balance and rates",
        "description": "Your balance and the rates you are billed at for texts you send, including any negotiated rate. When an agency pays for your account, every field is null and managed_billing_hidden is true.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/AccountBalance"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/account/balance": {
      "get": {
        "operationId": "account.balance.get",
        "tags": [
          "Account"
        ],
        "summary": "Get balance (older path)",
        "description": "Older path for GET /v1/account, same answer. An API key call gets a Deprecation header and a successor Link to /v1/account.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/AccountBalance"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/api-keys": {
      "get": {
        "operationId": "apiKeys.list",
        "tags": [
          "API Keys"
        ],
        "summary": "List API keys",
        "description": "The account live keys, newest first, without their secrets. Revoked keys and the test key are not listed. With X-Sub-Account-Id it lists that sub-account keys.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "apiKeys.create",
        "tags": [
          "API Keys"
        ],
        "summary": "Create an API key",
        "description": "Makes a new live key; your other keys keep working. The full key is in this response only, so store it now. Needs the owner key or a full power admin key. With X-Sub-Account-Id the key belongs to that sub-account and can only act as it. Not idempotent: a retry mints another key.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "A label to tell your keys apart. Default \"API Key\".",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApiKeyCreated"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "reserved_key_name",
          "borrowed_session",
          "OWNER_ONLY",
          "ACCESS_CHECK_UNAVAILABLE",
          "api_key_create_failed",
          "api_key_unconfirmed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/api-keys/all": {
      "get": {
        "operationId": "apiKeys.listAll",
        "tags": [
          "API Keys"
        ],
        "summary": "List keys across sub-accounts",
        "description": "Every live and test key of your agency and each of its sub-accounts, without their secrets. Needs the owner key or an admin key on the agency. To create or delete a sub-account key, call create or delete with X-Sub-Account-Id.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKeyOrganizationEntry"
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "sub_account_scope_forbidden",
          "organization_only",
          "sub_account_not_found",
          "too_many_sub_accounts",
          "too_many_api_keys",
          "api_keys_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/api-keys/failures": {
      "get": {
        "operationId": "apiKeys.failures.list",
        "tags": [
          "API Keys"
        ],
        "summary": "List failed requests",
        "description": "Requests made with your keys that got an error back, newest first, for the last 90 days. The same error on the same path is listed once a minute. Requests refused before the key was read (rate limits, overload, bad JSON) are not listed. There is no next cursor field: send the id of the last row as before while has_more is true.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Text to look for in the method, path, status, error code, error or request id. Up to 100 characters.",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "key_id",
            "in": "query",
            "required": false,
            "description": "Only this key requests. A key that is not yours gives an empty list.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "For the next page: the last id you got.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size. Default 50, max 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiFailure"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Whether there is another page."
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "has_more"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "api_failures_unavailable"
        ],
        "x-ready-pagination": {
          "style": "cursor",
          "cursorParam": "before",
          "nextCursorField": null,
          "cursorFromLastItemField": "id",
          "hasMoreField": "has_more",
          "itemsField": "data"
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/api-keys/{id}": {
      "delete": {
        "operationId": "apiKeys.delete",
        "tags": [
          "API Keys"
        ],
        "summary": "Delete an API key",
        "description": "Turns a key off; it stops working on the next request. Needs the owner key or an admin key. A second delete of the same key answers 404 api_key_not_found.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The key id from List API keys.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "OWNER_ONLY",
          "ACCESS_CHECK_UNAVAILABLE",
          "api_key_not_found",
          "api_key_revoke_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/area-codes/contacts": {
      "get": {
        "operationId": "areaCodes.contacts",
        "tags": [
          "Area codes"
        ],
        "summary": "Area codes of your contacts",
        "description": "Area codes ranked by how many of the account's contacts have a number there, most first (top 12). Cached for up to 6 hours.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "area_codes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "area_code": {
                                "type": "string"
                              },
                              "contacts": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/area-codes/suggested": {
      "get": {
        "operationId": "areaCodes.suggested",
        "tags": [
          "Area codes"
        ],
        "summary": "Suggest an area code",
        "description": "The local area code for a ZIP code. Without one, Ready uses the registered business's ZIP code, or before registration the area code of the account's phone number (then there is no zip). When nothing can be suggested, suggested is null and reason_code says why.",
        "parameters": [
          {
            "name": "zip",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "A US ZIP code; only its first 5 digits are read."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "suggested": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "true with an area code, or null when none can be suggested."
                        },
                        "area_code": {
                          "type": "string"
                        },
                        "display": {
                          "type": "string",
                          "description": "A sentence for people."
                        },
                        "zip": {
                          "type": "string",
                          "description": "The ZIP code used, when one was."
                        },
                        "reason_code": {
                          "type": "string",
                          "description": "When suggested is null: no_zip or zip_unmapped."
                        },
                        "reason": {
                          "type": "string",
                          "description": "The same in words; read reason_code, not this."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/automations/intent-training": {
      "get": {
        "operationId": "replySorting.guide.get",
        "tags": [
          "Reply Sorting"
        ],
        "summary": "Get the sorting guide",
        "description": "The description of your business that automations read before deciding if a reply is positive or negative. It does not change reply_category. Needs the manage_campaigns permission.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ReplySortingGuide"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "INTENT_TRAINING_LOAD_FAILED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/automations/intent-training/corrections": {
      "post": {
        "operationId": "replySorting.corrections.create",
        "tags": [
          "Reply Sorting"
        ],
        "summary": "Correct a sorted reply",
        "description": "Tells automations how they should have read one reply; later replies are sorted with your corrections as examples. reply_category on the reply is not changed. Sending it again for the same reply replaces the first correction. Needs the manage_campaigns permission.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message_id": {
                    "type": "integer",
                    "description": "Ready numeric id of the reply: message_id in the inbound_reply webhook.",
                    "minimum": 1
                  },
                  "label": {
                    "type": "string",
                    "description": "How it should have been read.",
                    "enum": [
                      "positive",
                      "negative",
                      "other"
                    ]
                  }
                },
                "required": [
                  "message_id",
                  "label"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ReplySortingCorrectionResult"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "REPLY_NOT_FOUND",
          "INTENT_CORRECTION_FAILED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/automations/intent-training/guide": {
      "put": {
        "operationId": "replySorting.guide.update",
        "tags": [
          "Reply Sorting"
        ],
        "summary": "Save the sorting guide",
        "description": "Replaces the guide; sending it again changes nothing. \"\" or leaving guide out clears it. Needs the manage_campaigns permission. On 503 INTENT_GUIDE_OUTCOME_UNKNOWN read it back; saving again is safe.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "guide": {
                    "type": "string",
                    "description": "Up to 600 characters. \"\" or left out clears it.",
                    "maxLength": 600
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ReplySortingGuide"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "INTENT_GUIDE_SAVE_FAILED",
          "INTENT_GUIDE_OUTCOME_UNKNOWN"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/balance": {
      "get": {
        "operationId": "balance.get",
        "tags": [
          "Account"
        ],
        "summary": "Get balance (older path)",
        "description": "Older path for GET /v1/account, same answer. An API key call gets a Deprecation header and a successor Link to /v1/account.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/AccountBalance"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/call-settings/inbound-routing": {
      "get": {
        "operationId": "callSettings.inboundRouting.get",
        "tags": [
          "Call settings"
        ],
        "summary": "Get who rings for incoming calls",
        "description": "Who the Ready Dialer rings when a lead calls one of the account's numbers. Needs send_sms.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string",
                          "description": "everyone: every online team member rings. last_caller: only the team member who last called that lead rings. See docs for the exceptions."
                        }
                      },
                      "required": [
                        "mode"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "permission_denied",
          "internal_error"
        ]
      },
      "put": {
        "operationId": "callSettings.inboundRouting.update",
        "tags": [
          "Call settings"
        ],
        "summary": "Change who rings for incoming calls",
        "description": "Sets the inbound ring mode. Needs manage_phones. The first save for an account turns missed-call text-back on only if a missed-call automation already sends a text.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "everyone",
                      "last_caller"
                    ],
                    "description": "everyone or last_caller."
                  }
                },
                "required": [
                  "mode"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string",
                          "description": "everyone: every online team member rings. last_caller: only the team member who last called that lead rings. See docs for the exceptions."
                        }
                      },
                      "required": [
                        "mode"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/call-settings/my-recording": {
      "get": {
        "operationId": "callSettings.myRecording.get",
        "tags": [
          "Call settings"
        ],
        "summary": "Get my Record switch",
        "description": "The key's own user's Record my calls choice for Ready Dialer calls. Account recording settings still win, and calls started with POST /v1/calls follow the account's Record calls. Needs send_sms.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/CallMyRecording"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "permission_denied",
          "internal_error"
        ]
      },
      "put": {
        "operationId": "callSettings.myRecording.update",
        "tags": [
          "Call settings"
        ],
        "summary": "Set my Record switch",
        "description": "Saves where the key's own user's Record switch starts in the Ready Dialer. Needs send_sms. Safe to repeat.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "record_calls": {
                    "type": "boolean",
                    "description": "Start with Record on or off."
                  },
                  "version": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "The version from the GET, only when syncing with the Ready Dialer."
                  }
                },
                "required": [
                  "record_calls"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "record_calls": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "record_calls"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/call-settings/recording": {
      "get": {
        "operationId": "callSettings.recording.get",
        "tags": [
          "Call settings"
        ],
        "summary": "Get call recording settings",
        "description": "Whether the account records calls and whether the recording notice plays, for every recorded call. Needs send_sms.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/CallRecordingSettings"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "permission_denied",
          "internal_error"
        ]
      },
      "put": {
        "operationId": "callSettings.recording.update",
        "tags": [
          "Call settings"
        ],
        "summary": "Change call recording settings",
        "description": "Send only what you want to change. Turning record_calls off also turns off record_every_call. Turning the notice off signs the waiver and needs attest: true and the signer's full name; every notice change is recorded. Only the account owner or an admin (403 OWNER_ONLY, upper case). Returns the saved settings without can_edit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "record_calls": {
                    "type": "boolean",
                    "description": "Record calls on this account."
                  },
                  "record_every_call": {
                    "type": "boolean",
                    "description": "Lock every team member's Record switch on."
                  },
                  "dual_speaker": {
                    "type": "boolean",
                    "description": "Keep each side of a recorded call on its own."
                  },
                  "notice": {
                    "type": "boolean",
                    "description": "Play the recording notice. false needs attest and name."
                  },
                  "attest": {
                    "type": "boolean",
                    "description": "true: you agree to the statement in attestation.text."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "The full name of the person signing."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/CallRecordingPolicy"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "attestation_required",
          "nothing_to_change",
          "invalid_field",
          "OWNER_ONLY",
          "permission_denied",
          "ACCESS_CHECK_UNAVAILABLE",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/calls": {
      "get": {
        "operationId": "calls.list",
        "tags": [
          "Calls"
        ],
        "summary": "List calls",
        "description": "Ended calls, newest first, phone and FaceTime together, each with its transcript. Page with cursor and next_cursor. A key user limited to assigned leads sees only their calls and calls with their leads. Needs view_messages.",
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "outbound",
                "inbound"
              ]
            },
            "description": "Leave out for both."
          },
          {
            "name": "channel",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "phone",
                "facetime"
              ]
            },
            "description": "Leave out for both."
          },
          {
            "name": "outcome",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "answered",
                "voicemail",
                "no_answer",
                "busy",
                "failed",
                "missed"
              ]
            },
            "description": "Only calls with this result."
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}(T[\\d:.]+(Z|[+-]\\d{2}:\\d{2})?)?$"
            },
            "description": "Only calls from this time on. A date or time without an offset is UTC."
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}(T[\\d:.]+(Z|[+-]\\d{2}:\\d{2})?)?$"
            },
            "description": "Only calls up to this time. A bare date includes that whole UTC day."
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "A phone number or a contact's name."
          },
          {
            "name": "contact_id",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[1-9]\\d{0,9}$"
            },
            "description": "Only calls with this contact."
          },
          {
            "name": "sub_account",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^(all|[1-9]\\d{0,9})$"
            },
            "description": "all, or one account id: read across your agency's sub-accounts. Needs the agency owner or an admin."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,3}$"
            },
            "description": "Calls per page. Default 25; 0 gives the default (see docs for the max)."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "The next_cursor from the last page."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "has_more",
                    "next_cursor"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Call"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Whether there is another page."
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as cursor for the next page."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-pagination": {
          "style": "cursor",
          "cursorParam": "cursor",
          "nextCursorField": "next_cursor",
          "hasMoreField": "has_more",
          "itemsField": "data"
        },
        "x-ready-error-codes": [
          "invalid_cursor",
          "invalid_field",
          "conversation_not_allocated",
          "sub_account_scope_forbidden",
          "organization_only",
          "sub_account_not_found",
          "too_many_sub_accounts",
          "permission_denied",
          "internal_error"
        ]
      },
      "post": {
        "operationId": "calls.create",
        "tags": [
          "Calls"
        ],
        "summary": "Start a call",
        "description": "Click-to-call: rings the team member's phone, then dials the lead and connects them (after a press of 1 unless confirm_answer is false). Billed per minute the lead is on the line; an unanswered lead is free. Needs send_sms. Send an Idempotency-Key so a retry never rings anyone twice; a 500 means the call may have started, so retry with the same key.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-ready-idempotent": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallStartRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The rep's phone is ringing.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/CallStartResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "bad_to",
          "bad_agent_phone",
          "insufficient_balance",
          "client_card_required",
          "account_held",
          "permission_denied",
          "opted_out",
          "do_not_call",
          "scrub_list",
          "blocklisted",
          "au_dncr",
          "quiet_hours",
          "agent_opted_out",
          "agent_do_not_call",
          "agent_blocklisted",
          "no_calling_number",
          "bad_from",
          "wrong_country",
          "too_many_live_calls",
          "provider_failed",
          "spend_check_failed",
          "idempotency_key_required",
          "idempotency_key_too_long",
          "idempotency_in_progress",
          "idempotency_outcome_unknown",
          "idempotency_unavailable",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/calls/{id}": {
      "get": {
        "operationId": "calls.get",
        "tags": [
          "Calls"
        ],
        "summary": "Get a call",
        "description": "One call with its transcript and transcript line times. Needs view_messages. Pass sub_account for a call on one of your sub-accounts.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The call id: out_123, in_456 or ft_789."
          },
          {
            "name": "sub_account",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^(all|[1-9]\\d{0,9})$"
            },
            "description": "all, or one account id: read across your agency's sub-accounts. Needs the agency owner or an admin."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/Call"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "call_not_found",
          "sub_account_scope_forbidden",
          "organization_only",
          "sub_account_not_found",
          "too_many_sub_accounts",
          "invalid_field",
          "permission_denied",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/calls/{id}/hangup": {
      "post": {
        "operationId": "calls.hangup",
        "tags": [
          "Calls"
        ],
        "summary": "Hang up a call",
        "description": "Ends an outbound call for both people, Ready Dialer calls too. ended is false when the call had already ended, so a repeat is safe. Needs send_sms.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "An out_ id: a call you or the Ready Dialer started. in_ and ft_ ids answer 404."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "call_id": {
                          "type": "string",
                          "description": "The id from the path."
                        },
                        "ended": {
                          "type": "boolean",
                          "description": "false when the call had already ended."
                        }
                      },
                      "required": [
                        "call_id",
                        "ended"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "call_not_found",
          "provider_failed",
          "permission_denied",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/calls/{id}/outcome": {
      "post": {
        "operationId": "calls.outcome",
        "tags": [
          "Calls"
        ],
        "summary": "Set a call outcome",
        "description": "Logs the rep's outcome (the disposition field) on an outbound call. A new value starts the account's call-outcome automations; sending the same one again changes nothing. It never changes the outcome field Ready records. Needs send_sms.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "An out_ id: a call you or the Ready Dialer started. in_ and ft_ ids answer 404."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "disposition": {
                    "type": "string",
                    "enum": [
                      "interested",
                      "callback",
                      "not_interested",
                      "voicemail",
                      "no_answer",
                      "wrong_number",
                      "dq"
                    ],
                    "description": "How the call went."
                  }
                },
                "required": [
                  "disposition"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "call_id": {
                          "type": "string"
                        },
                        "disposition": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "call_id",
                        "disposition"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "call_not_found",
          "permission_denied",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/calls/{id}/recording": {
      "get": {
        "operationId": "calls.recording",
        "tags": [
          "Calls"
        ],
        "summary": "Get a recording",
        "description": "The audio file itself, not JSON. Range requests work (206). Read Content-Type for the format: a phone call is WAV, a FaceTime call WebM or Ogg. A two channel dual-speaker WAV up to 64 MB is mixed down to one channel on the way out. 404 recording_not_found until the recording is stored; the call_recording_ready webhook says when.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The call id: out_123, in_456 or ft_789."
          },
          {
            "name": "sub_account",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^(all|[1-9]\\d{0,9})$"
            },
            "description": "all, or one account id: read across your agency's sub-accounts. Needs the agency owner or an admin."
          }
        ],
        "responses": {
          "200": {
            "description": "The recording audio.",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/ogg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Part of the recording, for a Range request.",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/webm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/ogg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "recording_not_found",
          "sub_account_scope_forbidden",
          "organization_only",
          "sub_account_not_found",
          "too_many_sub_accounts",
          "invalid_field",
          "permission_denied",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/compliance/night-texting": {
      "get": {
        "operationId": "compliance.nightTexting.get",
        "tags": [
          "Compliance"
        ],
        "summary": "Get texting at night",
        "description": "Whether the account's texting at night setting is on, and the words a caller agrees to when turning it on. Use X-Sub-Account-Id to read a sub-account.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/NightTexting"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "internal_error"
        ]
      },
      "post": {
        "operationId": "compliance.nightTexting.update",
        "tags": [
          "Compliance"
        ],
        "summary": "Turn texting at night on or off",
        "description": "While on, a 1:1 or API text to a contact who texted the account before may go out during quiet hours; campaigns, drips, automations, bulk sends and some states still wait for morning. Turning it on records attestation_text as a signed statement and needs confirmation_text I UNDERSTAND; turning it off needs nothing. Any enabled value that is not a readable true turns it off. Needs the owner's or an admin's key; an agency sets it per sub-account with X-Sub-Account-Id.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "true turns it on, false turns it off."
                  },
                  "confirmation_text": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Required to turn it on: I UNDERSTAND, agreeing to attestation_text."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/NightTexting"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "attestation_required",
          "invalid_field",
          "OWNER_ONLY",
          "owner_signed_in_only",
          "ACCESS_CHECK_UNAVAILABLE",
          "attestation_write_failed",
          "setting_write_failed",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/imessage-lines": {
      "get": {
        "operationId": "imessageLines.list",
        "tags": [
          "iMessage lines"
        ],
        "summary": "List iMessage lines",
        "description": "The account's iMessage lines, what one line costs the account a month (in cents) and the consent sentence a purchase agrees to. Every role can read it.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/IMessageLineList"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "internal_error"
        ]
      },
      "post": {
        "operationId": "imessageLines.create",
        "tags": [
          "iMessage lines"
        ],
        "summary": "Buy an iMessage line",
        "description": "Sets the line up and takes the first month held by POST /v1/imessage-lines/checkout; the line then bills monthly until cancelled. Send the checkout body without checkout_id, plus payment_intent_id (leave it out only when the checkout answered free). A finished purchase answers already_owned and takes nothing more. Needs manage_phones; test keys are refused.",
        "x-ready-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Strict: any other field (checkout_id included) answers 400 unknown_field.",
                "properties": {
                  "consent_attested": {
                    "type": "boolean",
                    "description": "true agrees to consent_text from GET /v1/imessage-lines. Without it nothing is held or bought (400 consent_required)."
                  },
                  "consent_attestation_text": {
                    "type": "string",
                    "description": "The sentence you showed. When sent it must match consent_text exactly, else 400 consent_required."
                  },
                  "blue_name": {
                    "type": "string",
                    "description": "The name people see for your first line. Required for the first line (else 400 order_details_invalid); an added line takes the first line's name."
                  },
                  "blue_photo": {
                    "type": "string",
                    "description": "A JPEG or PNG data URL for the first line's photo."
                  },
                  "expected_lines": {
                    "type": "integer",
                    "description": "How many lines you have now. Send it to add another line; a mismatch answers 409 lines_changed.",
                    "minimum": 0
                  },
                  "payment_intent_id": {
                    "type": "string",
                    "description": "The payment_intent_id from the checkout."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/IMessageLinePurchase"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "unknown_field",
          "consent_required",
          "line_unavailable",
          "order_details_invalid",
          "line_limit",
          "payment_invalid",
          "payment_required",
          "payment_not_held",
          "test_key_not_allowed",
          "consent_needs_customer",
          "line_refused",
          "payment_in_use",
          "line_purchase_in_progress",
          "line_needs_staff",
          "lines_changed",
          "price_changed",
          "line_unconfirmed",
          "line_save_failed",
          "line_outcome_unknown",
          "line_profile_unconfirmed",
          "consent_not_stored",
          "payment_check_unavailable",
          "line_check_unavailable",
          "billing_check_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/imessage-lines/cancel": {
      "post": {
        "operationId": "imessageLines.cancel",
        "tags": [
          "iMessage lines"
        ],
        "summary": "Cancel an iMessage line",
        "description": "Stops the line's monthly charge and takes it off the account; the current month is not refunded and it cannot be undone. When it is the last line, iMessage goes off. A retry after success answers 404 line_not_found. A 500 internal_error carries outcome_unknown true: list the lines before retrying.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Strict: any other field answers 400.",
                "properties": {
                  "line": {
                    "type": "string",
                    "description": "The line's phone number, from GET /v1/imessage-lines.",
                    "maxLength": 32
                  }
                },
                "required": [
                  "line"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/IMessageLineCancelResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "unknown_field",
          "test_key_not_allowed",
          "line_not_found",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/imessage-lines/checkout": {
      "post": {
        "operationId": "imessageLines.checkout",
        "tags": [
          "iMessage lines"
        ],
        "summary": "Start an iMessage line purchase",
        "description": "Holds the first month on the payer's saved card; nothing is taken until POST /v1/imessage-lines succeeds, and an unused hold drops off after about 7 days. With no usable card it answers a client_secret only the app can confirm; on an account with nothing to pay it answers free true. The Idempotency-Key header is required here (400 idempotency_key_required without it). Needs manage_phones; test keys are refused.",
        "x-ready-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Strict: any other field answers 400 unknown_field.",
                "properties": {
                  "consent_attested": {
                    "type": "boolean",
                    "description": "true agrees to consent_text from GET /v1/imessage-lines. Without it nothing is held or bought (400 consent_required)."
                  },
                  "consent_attestation_text": {
                    "type": "string",
                    "description": "The sentence you showed. When sent it must match consent_text exactly, else 400 consent_required."
                  },
                  "blue_name": {
                    "type": "string",
                    "description": "The name people see for your first line. Required for the first line (else 400 order_details_invalid); an added line takes the first line's name."
                  },
                  "blue_photo": {
                    "type": "string",
                    "description": "A JPEG or PNG data URL for the first line's photo."
                  },
                  "expected_lines": {
                    "type": "integer",
                    "description": "How many lines you have now. Send it to add another line; a mismatch answers 409 lines_changed.",
                    "minimum": 0
                  },
                  "checkout_id": {
                    "type": "string",
                    "description": "Your own UUID for this purchase; a retry with the same one gets the same hold back. A non-UUID is ignored."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/IMessageLineCheckout"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "idempotency_key_required",
          "invalid_field",
          "unknown_field",
          "consent_required",
          "line_unavailable",
          "line_limit",
          "order_details_invalid",
          "test_key_not_allowed",
          "line_refused",
          "lines_changed",
          "purchase_in_progress",
          "checkout_unconfirmed",
          "checkout_unavailable",
          "billing_check_unavailable",
          "line_check_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/local-presence": {
      "get": {
        "operationId": "localPresence.get",
        "tags": [
          "Number health"
        ],
        "summary": "Get local presence",
        "description": "Whether texts and calls go out from a number local to the contact. Older accounts have it on by default for free (opt_in false); newer accounts turn it on themselves and are charged per segment.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean",
                          "description": "The setting in force."
                        },
                        "opt_in": {
                          "type": "boolean",
                          "description": "false for an older account (on by default, free); true for a newer one, on only if the account turned it on."
                        },
                        "price_per_text_usd": {
                          "type": "number",
                          "description": "Cost per segment of a delivered text, in dollars. 0 when not charged."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "SETTING_LOAD_FAILED"
        ]
      },
      "put": {
        "operationId": "localPresence.update",
        "tags": [
          "Number health"
        ],
        "summary": "Turn local presence on or off",
        "description": "Turns local presence on or off for the account. Each change is recorded in the account's history; sending the value already set changes nothing. An agency can lock the switch for a sub-account. Needs manage_phones.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "true or false. The strings \"true\"/\"false\" and 1/0 are also read; anything else is refused with toggle_invalid."
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "enabled"
                      ],
                      "properties": {
                        "enabled": {
                          "type": "boolean",
                          "description": "The setting now."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "toggle_invalid",
          "products_locked",
          "SETTING_SAVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/media": {
      "post": {
        "operationId": "media.upload",
        "tags": [
          "Media"
        ],
        "summary": "Upload a file",
        "description": "Stores a photo, video, PDF, Office doc, CSV, text file or voice note and returns a public url to pass as media_url when sending. The answer is a bare body: url, content_type and size sit at the top level, with no data key. Each upload stores a new copy, so a retry is safe; uploads are capped at 60 per 10 minutes per account. Attachments unlock once a business registration is submitted and paid.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The file as multipart/form-data, up to 20 MB (a smaller limit before registration is approved)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaUploadResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "NO_FILE",
          "UNSUPPORTED_FILE_TYPE",
          "FILE_CONTENT_MISMATCH",
          "UPLOAD_FAILED",
          "media_malware",
          "media_flagged",
          "attachments_need_registration",
          "FILE_TOO_LARGE",
          "FILE_TOO_SCAN_LARGE",
          "UPLOAD_RATE_LIMITED",
          "media_scan_unavailable",
          "media_account_read_failed",
          "media_registration_read_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/media/brand-logo": {
      "post": {
        "operationId": "media.uploadBrandLogo",
        "tags": [
          "Media"
        ],
        "summary": "Upload a white label logo",
        "description": "Stores an agency's white label logo (PNG, JPG, WebP or GIF) and returns its public url, in the same bare body as POST /v1/media. Needs the manage_brands permission and a white label brand (sign the agreement first, else 403 logo_needs_brand). It shares the upload counter with POST /v1/media.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The logo image as multipart/form-data."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaUploadResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "NO_FILE",
          "UNSUPPORTED_FILE_TYPE",
          "FILE_CONTENT_MISMATCH",
          "UPLOAD_FAILED",
          "UNSUPPORTED_LOGO_TYPE",
          "media_malware",
          "media_flagged",
          "logo_needs_brand",
          "FILE_TOO_LARGE",
          "UPLOAD_RATE_LIMITED",
          "media_scan_unavailable",
          "media_account_read_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/messages": {
      "post": {
        "operationId": "messages.create",
        "tags": [
          "Messages"
        ],
        "summary": "Send a message",
        "description": "Sends one SMS or MMS. A 200 means accepted, not delivered; a 202 means the text is held (quiet hours, a number still activating, or carrier capacity) and sends on its own at data.send_at, so do not resend it. A 200 with success false and error_code empty_merge_field means a merge field is blank and nothing was sent: resend with confirm_empty_merge true. A from that is one of your iMessage lines sends as iMessage instead, and the answer is the iMessage shape (integer message_id, channel imessage, public_message_id).",
        "x-ready-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "to is required, and body (or an alias) or media_url.",
                "properties": {
                  "to": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "Recipient phone number, E.164 recommended (+12125550199). A 10-digit US number is treated as +1. Required (To is accepted as an alias)."
                  },
                  "body": {
                    "type": "string",
                    "description": "The text. message and Body are aliases. Required unless media_url is sent."
                  },
                  "message": {
                    "type": "string",
                    "description": "Alias of body."
                  },
                  "from": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "One of your numbers (from GET /v1/numbers) or one of your iMessage lines. Omit it and Ready picks. The answer's from is the number actually used. A value that is neither answers 400 invalid_from."
                  },
                  "media_url": {
                    "type": "string",
                    "description": "A public http or https URL of an image to attach (MediaUrl is an alias). Upload a file with POST /v1/media to get one."
                  },
                  "consent_attested": {
                    "type": [
                      "boolean",
                      "string",
                      "integer"
                    ],
                    "description": "Your promise that this recipient agreed to messages from you. true, \"true\" and 1 count as true. Optional today with a warning; from January 20, 2027 an API key send without it is refused with 403 api_consent_attested_required."
                  },
                  "consent_attestation_text": {
                    "type": "string",
                    "description": "Optional: the consent sentence you showed the recipient, recorded with the attestation."
                  },
                  "from_strategy": {
                    "type": "string",
                    "description": "How Ready picks the number when from is not set: local, even, deliverability or random. Any other value is ignored."
                  },
                  "confirm_empty_merge": {
                    "type": "boolean",
                    "description": "Send true to send even though a merge field is blank."
                  },
                  "override_quiet_hours": {
                    "type": "boolean",
                    "description": "Send true after a 409 QUIET_HOURS_BLOCK that had can_override true. Lifts only the account's own quiet hours, never the legal ones."
                  },
                  "hold_until_allowed": {
                    "type": "boolean",
                    "description": "Accepted, and changes nothing: every text that quiet hours block is held until the recipient's window opens (202 held) either way."
                  },
                  "conversation_id": {
                    "type": "integer",
                    "description": "File the text in this conversation. An id not on your account is ignored."
                  },
                  "quoted_message_id": {
                    "type": "integer",
                    "description": "A message id in that conversation to quote (inbox only)."
                  },
                  "To": {
                    "type": "string",
                    "description": "Capitalised alias of to."
                  },
                  "From": {
                    "type": "string",
                    "description": "Capitalised alias of from."
                  },
                  "Body": {
                    "type": "string",
                    "description": "Capitalised alias of body."
                  },
                  "MediaUrl": {
                    "type": "string",
                    "description": "Capitalised alias of media_url."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted (or, with success false, a blank merge field that needs confirmation; or recorded false: sent and charged but not saved, do not resend).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSendResponse"
                }
              }
            }
          },
          "202": {
            "description": "Held to send later (data.status held), or error_code send_outcome_unknown (success false, outcome unknown: it may have been sent).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageHeldResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "504": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "invalid_field",
          "invalid_from",
          "NO_APPROVED_CAMPAIGN",
          "NUMBER_SETUP_UNCONFIRMED",
          "country_not_supported",
          "no_sender_number",
          "no_country_sender",
          "MESSAGE_TOO_LONG",
          "CONTENT_BLOCKED",
          "invalid_media_url",
          "insufficient_balance",
          "client_card_required",
          "MONTHLY_CAP_REACHED",
          "BILLING_PAST_DUE",
          "FRAUD_HOLD",
          "CARD_REQUIRED",
          "opt_out_locked",
          "dnc_list",
          "tcpa_block",
          "global_blocklist",
          "number_not_assigned",
          "api_consent_attested_required",
          "QUIET_HOURS_BLOCK",
          "RAMP_CAP_REACHED",
          "duplicate_send",
          "number_activating",
          "idempotency_in_progress",
          "INVALID_DESTINATION",
          "rate_limited",
          "daily_cap",
          "number_daily_cap",
          "send_failed",
          "hold_not_returned",
          "reservation_unconfirmed",
          "INTERNAL_ERROR_OUTCOME_UNKNOWN",
          "provider_busy",
          "gate_check_failed",
          "carrier_capacity_busy",
          "contact_unavailable",
          "consent_check_failed",
          "sending_paused",
          "permission_check_unavailable",
          "CONTENT_REVIEW_UNAVAILABLE",
          "ADMISSION_SHED",
          "send_dedupe_unavailable",
          "billing_check_unavailable",
          "REQUEST_TIMEOUT_OUTCOME_UNKNOWN",
          "send_outcome_unknown",
          "empty_merge_field"
        ]
      },
      "get": {
        "operationId": "messages.list",
        "tags": [
          "Messages"
        ],
        "summary": "List messages",
        "description": "The account's sent and received messages, newest first, including texts team members sent. Paged by before_id: pass next_before_id back. has_more is true on an exactly full page, so the last page can be empty. offset and page are ignored (with a warnings sentence).",
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "inbound or outbound. Any other value is ignored (no filter)."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only messages to this number (E.164 recommended). Must contain digits, else 400 invalid_to. A full number matches the common stored spellings; a partial number that matches too much history answers 422 search_too_broad."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only messages from this number. Same matching rules as to; no digits answers 400 invalid_from."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "A public status word (queued, delivered, failed, undelivered, received and the others listed in the docs). Another word is not refused: it matches only rows stored with exactly that word, and the answer carries warnings."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "Page size, default 50, max 200."
          },
          {
            "name": "before_id",
            "in": "query",
            "schema": {
              "type": [
                "integer",
                "string"
              ]
            },
            "description": "The next_before_id of the previous page (a row id). A row's public id also works. An id that names no message on the account answers 400 invalid_before_id."
          }
        ],
        "x-ready-pagination": {
          "style": "cursor",
          "cursorParam": "before_id",
          "nextCursorField": "next_before_id",
          "hasMoreField": "has_more",
          "itemsField": "data"
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_to",
          "invalid_from",
          "invalid_field",
          "invalid_before_id",
          "search_too_broad"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/messages/bulk": {
      "post": {
        "operationId": "messages.bulk",
        "tags": [
          "Messages"
        ],
        "summary": "Send to many",
        "description": "Sends one text to up to 100 recipients, each through the full single-send path, and answers 200 once all are done even if every recipient failed: check data.failed and each results[].sent. It is synchronous, so set a long client timeout and retry a timeout with the same Idempotency-Key. Every 4xx refusal here comes before anything is sent and is not stored under the key. group true sends one shared group text (2 to 10 numbers, a from on an approved campaign, no merge fields).",
        "x-ready-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Recipient numbers, E.164 recommended, up to 100. Entries that are not non-empty strings are skipped. Duplicates are not merged (the repeat is refused as duplicate_send), except on a group text."
                  },
                  "body": {
                    "type": "string",
                    "description": "The text for every recipient. message is an alias."
                  },
                  "message": {
                    "type": "string",
                    "description": "Alias of body."
                  },
                  "from": {
                    "type": [
                      "string",
                      "number"
                    ],
                    "description": "One of your numbers. Must be a single value (a list or object answers 400 invalid_field)."
                  },
                  "media_url": {
                    "type": "string",
                    "description": "An http or https image URL, as on POST /v1/messages. An invalid one refuses the whole batch with invalid_media_url."
                  },
                  "group": {
                    "type": "boolean",
                    "description": "true sends one group text: everyone in to gets it in one shared thread."
                  },
                  "consent_attested": {
                    "type": [
                      "boolean",
                      "string",
                      "integer"
                    ],
                    "description": "Your promise that this recipient agreed to messages from you. true, \"true\" and 1 count as true. Optional today with a warning; from January 20, 2027 an API key send without it is refused with 403 api_consent_attested_required."
                  },
                  "consent_attestation_text": {
                    "type": "string",
                    "description": "Optional: the consent sentence you showed the recipient, recorded with the attestation."
                  },
                  "confirm_empty_merge": {
                    "type": "boolean",
                    "description": "Send true to send even when a merge field is blank for some recipients."
                  },
                  "hold_until_allowed": {
                    "type": "boolean",
                    "description": "Accepted, and changes nothing: recipients that quiet hours block are held until their window opens either way. A group text is never held."
                  }
                },
                "required": [
                  "to",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/MessageBulkResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "invalid_field",
          "too_many_recipients",
          "invalid_from",
          "invalid_media_url",
          "invalid_group_size",
          "group_from_required",
          "group_from_unregistered",
          "group_merge_fields",
          "insufficient_credits",
          "client_card_required",
          "idempotency_in_progress",
          "throughput_exceeded",
          "rate_limited",
          "bulk_check_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/messages/bulk-delete": {
      "post": {
        "operationId": "messages.bulkDelete",
        "tags": [
          "Messages"
        ],
        "summary": "Delete many messages",
        "description": "Removes up to 5,000 messages from the account's message log for good. Ids not in the account are skipped. Needs the delete_messages permission; test keys are refused. A retry deletes nothing more and answers deleted 0.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": [
                        "string",
                        "integer"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 5000,
                    "description": "1 to 5,000 message ids as strings exactly as you got them (a whole-number row id is also accepted), each at most 100 characters."
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/MessageBulkDeleteResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "423": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "NO_MESSAGES_SELECTED",
          "TOO_MANY_MESSAGES",
          "INVALID_MESSAGE_IDS",
          "MESSAGE_NOT_ASSIGNED",
          "test_key_not_allowed",
          "LITIGATION_HOLD",
          "message_reference_ambiguous",
          "WALL_READ_FAILED",
          "HOLD_CHECK_UNAVAILABLE"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/messages/{id}": {
      "get": {
        "operationId": "messages.get",
        "tags": [
          "Messages"
        ],
        "summary": "Get a message",
        "description": "One message the account sent or received, by the message_id a send returned, the id GET /v1/messages lists, or a row id. data.id is the public id; data.message_id echoes the id you asked with. Another account's message answers 404, as a missing one does. Test-mode messages are not stored.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The message id, sent as a string exactly as you got it (public ids can exceed 15 digits)."
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/MessageDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "message_not_found",
          "message_reference_ambiguous"
        ]
      },
      "delete": {
        "operationId": "messages.delete",
        "tags": [
          "Messages"
        ],
        "summary": "Delete a message",
        "description": "Removes one message from the account's message log for good; an emptied conversation goes too. Needs the delete_messages permission; test keys are refused. Calling it again for the same id answers 404 MESSAGE_NOT_FOUND, so a retry never removes anything else.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "The id from GET /v1/messages, the message_id a send returned, or an inbound_reply webhook's message_id, as a string."
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/MessageDeleteResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "423": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "INVALID_MESSAGE_ID",
          "unknown_field",
          "MESSAGE_NOT_ASSIGNED",
          "test_key_not_allowed",
          "MESSAGE_NOT_FOUND",
          "LITIGATION_HOLD",
          "message_reference_ambiguous",
          "WALL_READ_FAILED",
          "HOLD_CHECK_UNAVAILABLE"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers": {
      "get": {
        "operationId": "numbers.list",
        "tags": [
          "Numbers"
        ],
        "summary": "List numbers",
        "description": "Every number on the account, newest first, including pending and failed ones, so check status. Paging is opt-in: send limit or before_id. The unpaged list also includes the account's iMessage lines (type imessage, id null).",
        "parameters": [
          {
            "name": "include_sub_accounts",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Send true to also list sub-account numbers (top-level agency accounts only). Each number then carries account_id."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Page size (max: see docs). With limit or before_id the list is paged newest id first and carries has_more and next_before_id; without either, every number answers at once, iMessage lines included."
          },
          {
            "name": "before_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "The next_before_id from the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Number"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Only when paged."
                    },
                    "next_before_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Only when paged. Send as before_id; null on an empty page."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_limit",
          "invalid_before_id",
          "internal_error"
        ],
        "x-ready-pagination": {
          "style": "cursor",
          "cursorParam": "before_id",
          "nextCursorField": "next_before_id",
          "hasMoreField": "has_more",
          "itemsField": "data"
        }
      },
      "post": {
        "operationId": "numbers.create",
        "tags": [
          "Numbers"
        ],
        "summary": "Buy a number",
        "description": "Provisions the number paid for at checkout: call POST /v1/numbers/checkout first and send its payment_intent_id. Each payment_intent_id provisions exactly one number. The answer fields sit at the top level, not inside data. A refusal after you paid carries charge_returned: false means contact support before buying again. Needs manage_phones.",
        "x-ready-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "area_code": {
                    "type": "string",
                    "description": "Required for a US number: the area code you checked out with. For CA it may name a Canadian area code; ignored for other countries."
                  },
                  "payment_intent_id": {
                    "type": "string",
                    "description": "data.payment_intent_id from checkout."
                  },
                  "country": {
                    "type": "string",
                    "description": "The same country you checked out with, for an overseas number (see docs for the open countries). Leave out for a US number."
                  },
                  "replaces_phone_id": {
                    "type": "integer",
                    "description": "The id of one of your numbers this purchase replaces; send the same value at checkout."
                  }
                },
                "required": [
                  "payment_intent_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumberPurchaseResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "area_code_invalid",
          "order_details_invalid",
          "payment_intent_required",
          "payment_not_confirmed",
          "payment_not_for_number",
          "payment_not_taken",
          "payment_not_expected",
          "payment_unverified",
          "payment_order_mismatch",
          "payment_refunded",
          "invalid_field",
          "no_campaign",
          "country_unavailable",
          "card_required",
          "PURCHASE_BLOCKED",
          "payment_not_owned",
          "payment_intent_already_used",
          "purchase_in_progress",
          "campaign_number_limit",
          "area_code_unavailable",
          "buy_incomplete",
          "buy_failed",
          "carrier_submit_failed",
          "order_unconfirmed",
          "provision_cap",
          "availability_check_unavailable",
          "order_not_started",
          "billing_check_unavailable",
          "payments_unavailable",
          "payment_check_unavailable",
          "payment_claim_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/available": {
      "get": {
        "operationId": "numbers.available",
        "tags": [
          "Numbers"
        ],
        "summary": "Check an area code",
        "description": "Whether a number can be bought in an area code now. The fields sit at the top level beside success, not inside data. numbers is always empty: Ready assigns the number when you buy.",
        "parameters": [
          {
            "name": "area_code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[2-9]\\d{2}$"
            },
            "description": "A 3-digit area code."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "available"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "available": {
                      "type": "boolean",
                      "description": "true means a number can be bought there now."
                    },
                    "ready": {
                      "type": "boolean",
                      "description": "Only when available is true. true: a number is ready to hand over; false: it is ordered from the carrier at purchase and set up in a few minutes."
                    },
                    "area_code": {
                      "type": "string"
                    },
                    "numbers": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Always empty."
                    },
                    "alternatives": {
                      "type": "array",
                      "description": "When not available: nearby area codes.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "area_code": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "ready": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "area_code_invalid",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/checkout": {
      "post": {
        "operationId": "numbers.checkout",
        "tags": [
          "Numbers"
        ],
        "summary": "Start a number purchase",
        "description": "Pays (or holds) the first month on the saved card and returns the payment_intent_id to send to POST /v1/numbers. One number per checkout. Send checkout_id (a UUID) so a retry never charges twice. With no saved card, or when the bank wants the card confirmed, nothing is charged and the purchase must be finished in the app. Needs manage_phones.",
        "x-ready-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "area_code": {
                    "type": "string",
                    "description": "Required for a US number: the 3-digit area code. For CA it may name a Canadian area code; leave out for other countries."
                  },
                  "checkout_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Your own UUID for this purchase. A retry with the same UUID gets the same checkout back."
                  },
                  "country": {
                    "type": "string",
                    "description": "A country code where Ready sells numbers (see docs). Leave out for a US number."
                  },
                  "replaces_phone_id": {
                    "type": "integer",
                    "description": "The id of one of your numbers this purchase replaces."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/NumberCheckout"
                    },
                    "reused": {
                      "type": "boolean",
                      "description": "Only when true: a retry of the same checkout_id, answered with its first payment."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "area_code_invalid",
          "country_unavailable",
          "checkout_id_invalid",
          "card_declined",
          "card_authentication_required",
          "card_required",
          "PURCHASE_BLOCKED",
          "area_code_unavailable",
          "purchase_in_progress",
          "campaign_number_limit",
          "checkout_id_in_use",
          "checkout_finished",
          "country_sold_out",
          "checkout_unconfirmed",
          "checkout_unavailable",
          "availability_check_unavailable",
          "cap_check_unavailable",
          "billing_check_unavailable",
          "billing_account_unavailable",
          "number_price_unavailable",
          "payments_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/sent-7d": {
      "get": {
        "operationId": "numbers.sent7d",
        "tags": [
          "Numbers"
        ],
        "summary": "Texts sent per number, last 7 days",
        "description": "How many texts each number sent on each of the last 7 UTC days, oldest first. Includes sub-account numbers. The answer is under spark at the top level, not data.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "spark"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "spark": {
                      "type": "object",
                      "description": "Keyed by phone number (E.164). Each value is 7 counts, oldest day first. A number that sent nothing is not listed.",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}": {
      "get": {
        "operationId": "numbers.get",
        "tags": [
          "Numbers"
        ],
        "summary": "Get a number",
        "description": "One number. Poll this after a purchase until status is active, and stop on provider_rejected or payment_declined. A released number answers status deleted or 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "number_not_found",
          "internal_error"
        ]
      },
      "put": {
        "operationId": "numbers.update",
        "tags": [
          "Numbers"
        ],
        "summary": "Set a number's webhook",
        "description": "Sets the number's own webhook URL: replies to it and delivery statuses of texts from it go there instead of the account webhook, signed with the account's secret. Save an account webhook first. null or an empty string clears it. Needs manage_integrations and the account owner or an admin; only a number the account holds itself (call as a sub-account for its numbers).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook_url": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "An https URL on a public host, or null / \"\" to clear."
                  }
                },
                "required": [
                  "webhook_url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "nothing_to_update",
          "invalid_url",
          "OWNER_ONLY",
          "number_not_found",
          "account_webhook_required",
          "number_webhook_limit"
        ]
      },
      "delete": {
        "operationId": "numbers.delete",
        "tags": [
          "Numbers"
        ],
        "summary": "Release a number",
        "description": "Permanent: the number goes back to the carrier and the monthly fee stops (the current month is not refunded). A 202 with code RELEASE_PENDING is not a finished release: the number stays on the account until the carrier confirms. The API cannot release an account's last sending number; do that in the dashboard. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/Error"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "RELEASE_PENDING",
          "invalid_id",
          "NUMBER_NOT_FOUND",
          "CLIENT_PAYS_FOR_NUMBER",
          "NUMBER_RESERVED",
          "NUMBER_SETTING_UP",
          "NUMBER_KEY_UNKNOWN",
          "REPLACEMENT_IN_FLIGHT",
          "LAST_NUMBER_CONFIRM",
          "RELEASE_INCOMPLETE",
          "BILLING_CANCEL_FAILED",
          "permission_check_unavailable",
          "shutting_down"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/assign": {
      "post": {
        "operationId": "numbers.assign",
        "tags": [
          "Numbers"
        ],
        "summary": "Move a number to a sub-account",
        "description": "Gives a number the account holds to one of its own sub-accounts; you keep paying for it. Call forwarding and caller ID name on the number are turned off. If the sub-account has its own approved registration with room, the number moves onto it. A repeat call on a number already there answers 200 again. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sub_account_id": {
                    "type": "integer",
                    "description": "The sub-account to give it to."
                  }
                },
                "required": [
                  "sub_account_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "registration": {
                          "type": "string",
                          "description": "moved, kept, full or failed. The number itself moved in every case."
                        },
                        "sub_account_id": {
                          "type": "integer"
                        },
                        "number_id": {
                          "type": "integer"
                        }
                      }
                    },
                    "registration": {
                      "type": "string",
                      "description": "The same as data.registration, kept for older callers."
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "SUB_ACCOUNT_REQUIRED",
          "NUMBER_NOT_FOUND",
          "sub_account_not_found",
          "NUMBER_ASSIGN_BLOCKED",
          "ASSIGN_NOT_APPLIED",
          "MOVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/daily-cap": {
      "put": {
        "operationId": "numbers.dailyCap.update",
        "tags": [
          "Numbers"
        ],
        "summary": "Set a number's daily cap",
        "description": "The most texts this number sends in a day; at the cap Ready sends from another number with room. 0, null or leaving it out removes the cap. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cap": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "A whole number of texts (max: see docs). 0 or null removes the cap."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "phone_number": {
                          "type": "string"
                        },
                        "daily_cap_sms": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "The cap now; null means no cap."
                        },
                        "sent_today": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Texts sent today, or null when they could not be counted."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "DAILY_CAP_INVALID",
          "NUMBER_NOT_FOUND",
          "SETTING_SAVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/deliverability": {
      "get": {
        "operationId": "numbers.deliverability",
        "tags": [
          "Numbers"
        ],
        "summary": "Get a number's delivery",
        "description": "How one number's texts deliver: rates over 24 hours, 7 and 30 days, each carrier over 7 days, top carrier errors, and the saved spam signals. Sent at the top level, not inside data. Carrier breakdown and error counts are strings of digits. Cached for about 10 minutes.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumberDeliverability"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "NUMBER_NOT_FOUND",
          "DELIVERABILITY_LOAD_FAILED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/forwarding": {
      "put": {
        "operationId": "numbers.forwarding.update",
        "tags": [
          "Numbers"
        ],
        "summary": "Forward calls",
        "description": "Rings another phone when someone calls this number, or sends its calls to the account's SIP trunk. A forwarded call is not recorded and sends no call webhooks (except forward_when no_answer, which rings the dialer first). Send forward_to_number null or \"\" to turn it off. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "forward_to_number": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "A US or Canadian number outside Ready. \"\" or null turns forwarding off. Required unless calls_to is sip or off."
                  },
                  "calls_to": {
                    "type": "string",
                    "enum": [
                      "sip",
                      "phone",
                      "off"
                    ],
                    "description": "sip rings the SIP trunk; phone forwards to forward_to_number; off turns forwarding off. A number on the trunk set to phone or off leaves the trunk."
                  },
                  "forward_when": {
                    "type": "string",
                    "enum": [
                      "always",
                      "no_answer"
                    ],
                    "description": "always (default) rings forward_to_number at once; no_answer rings an open Ready Dialer first for 30 seconds."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "forward_to_number": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Where calls now go, E.164, or null."
                        },
                        "calls_to": {
                          "type": "string",
                          "description": "sip, phone or off."
                        },
                        "forward_when": {
                          "type": "string",
                          "description": "always or no_answer, when forwarding was turned on."
                        },
                        "routed": {
                          "type": "boolean",
                          "description": "true when forwarding was turned on with the carrier (forward_when always)."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "FORWARD_TO_REQUIRED",
          "forward_to_invalid",
          "forward_to_service_code",
          "forward_to_premium",
          "forward_to_not_us_ca",
          "FORWARD_TO_READY_NUMBER",
          "NUMBER_NO_VOICE",
          "NUMBER_SETTING_UP",
          "NUMBER_NOT_READY",
          "SIP_TRUNKING_UNAVAILABLE",
          "CALL_FORWARDING_UNAVAILABLE",
          "NUMBER_NOT_FOUND",
          "SIP_TRUNK_NOT_SET_UP",
          "SIP_TRUNK_SET_UNCONFIRMED",
          "FORWARD_ON_NOT_SAVED",
          "FORWARD_OFF_NOT_SAVED",
          "SIP_TRUNK_DETACH_UNCONFIRMED",
          "FORWARD_SET_UNCONFIRMED",
          "FORWARD_CLEAR_UNCONFIRMED",
          "FORWARD_CHECK_UNAVAILABLE"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/name": {
      "put": {
        "operationId": "numbers.name.update",
        "tags": [
          "Numbers"
        ],
        "summary": "Rename a number",
        "description": "Gives the number a label, shown as name on the number. \"\" or null clears it; a body without name is refused. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The label (max length: see docs). \"\" or null clears it."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "NAME_REQUIRED",
          "NUMBER_NOT_FOUND",
          "SETTING_SAVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/primary": {
      "put": {
        "operationId": "numbers.primary.update",
        "tags": [
          "Numbers"
        ],
        "summary": "Make a number your primary",
        "description": "Makes this the account's default sending number, used when from is left out and no other rule picks one. The other numbers stop being primary. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "NUMBER_NOT_FOUND",
          "SETTING_SAVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/registration": {
      "put": {
        "operationId": "numbers.registration.update",
        "tags": [
          "Numbers"
        ],
        "summary": "Move a number to another campaign",
        "description": "Moves the number onto another approved registration campaign on the account. A campaign's only number stays where it is. Sending the campaign it is already on answers success. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaign_id": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "One of choices[].campaign_id from GET /v1/numbers/{id}/registrations."
                  }
                },
                "required": [
                  "campaign_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "REGISTRATION_NOT_ALLOWED",
          "NUMBER_NOT_FOUND",
          "NUMBER_NOT_MOVABLE",
          "only_number_on_brand",
          "campaign_number_limit",
          "REGISTRATION_MOVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/registrations": {
      "get": {
        "operationId": "numbers.registrations.list",
        "tags": [
          "Numbers"
        ],
        "summary": "List campaigns a number can move to",
        "description": "The registration campaign the number sends under now and the approved ones on the account it can move to. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "current": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The campaign id the number is on (same as campaign_id on the number)."
                        },
                        "choices": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "campaign_id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "NUMBER_NOT_FOUND",
          "REGISTRATIONS_UNAVAILABLE"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/reprovision": {
      "post": {
        "operationId": "numbers.reprovision",
        "tags": [
          "Numbers"
        ],
        "summary": "Replace a rejected number",
        "description": "Orders a new number in another area code for a number the carrier rejected (status provider_rejected), at no charge. The number keeps its id and goes back to pending_provisioning; poll GET /v1/numbers/{id}. US numbers only. Do not retry on reprovision_unconfirmed or reprovision_incomplete. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "area_code": {
                    "type": "string",
                    "pattern": "^[2-9]\\d{2}$",
                    "description": "A 3-digit US area code."
                  }
                },
                "required": [
                  "area_code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "pending_provisioning": {
                      "type": "boolean"
                    },
                    "phone_number_id": {
                      "type": "integer",
                      "description": "The same number id."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "area_code_invalid",
          "no_campaign",
          "NUMBER_NOT_FOUND",
          "reprovision_not_available",
          "campaign_number_limit",
          "reprovision_in_progress",
          "number_released",
          "reprovision_failed",
          "reprovision_unconfirmed",
          "reprovision_incomplete",
          "provision_cap",
          "reprovision_claim_unconfirmed",
          "number_owner_unavailable",
          "campaign_check_unavailable",
          "availability_check_unavailable",
          "number_check_unavailable",
          "shutting_down"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/rest": {
      "post": {
        "operationId": "numbers.rest",
        "tags": [
          "Numbers"
        ],
        "summary": "Rest a number",
        "description": "Stops Ready from picking this number as a sender; you can still send from it by naming it in from. Leave hours out to rest it until resumed. The account's last awake sending number cannot be rested. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hours": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Whole hours to rest, 1 to the maximum (see docs). Leave out to rest until resumed."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "phone_number": {
                          "type": "string"
                        },
                        "friendly_name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "rested_until": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ISO 8601."
                        }
                      }
                    },
                    "hours": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "The hours sent, or null for until resumed."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "LAST_SENDING_NUMBER",
          "REST_HOURS_INVALID",
          "NUMBER_NOT_FOUND",
          "SETTING_SAVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/resume": {
      "post": {
        "operationId": "numbers.resume",
        "tags": [
          "Numbers"
        ],
        "summary": "Resume a number",
        "description": "Ends a rest so Ready picks the number as a sender again. Safe on a number that is not resting. A number Ready rested because its registration is full answers 409; change its registration instead. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "NUMBER_NOT_FOUND",
          "NUMBER_CAMPAIGN_FULL",
          "SETTING_SAVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/spam-check": {
      "get": {
        "operationId": "numbers.spamCheck",
        "tags": [
          "Numbers"
        ],
        "summary": "Check a number for spam reports",
        "description": "Searches the web for spam reports about one number and saves the result on the number. A number checked recently answers the saved result with cached true. status unknown is not a clean result and is not saved.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/NumberSpamCheck"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "NUMBER_NOT_FOUND",
          "SPAM_CHECK_FAILED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/unassign": {
      "post": {
        "operationId": "numbers.unassign",
        "tags": [
          "Numbers"
        ],
        "summary": "Take a number back from a sub-account",
        "description": "The reverse of POST /v1/numbers/{id}/assign: moves a number held by a direct sub-account back to your account. A number already yours answers success with message Number already belongs to you. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "registration": {
                      "type": [
                        "object",
                        "string",
                        "null"
                      ],
                      "description": "The registration campaign the number now sends under, when it moved onto one."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "NUMBER_NOT_FOUND",
          "CLIENT_PAYS_FOR_NUMBER",
          "NUMBER_ASSIGN_BLOCKED",
          "UNASSIGN_NOT_APPLIED",
          "MOVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/numbers/{id}/usage": {
      "put": {
        "operationId": "numbers.usage.update",
        "tags": [
          "Numbers"
        ],
        "summary": "Use a number for texting or calling",
        "description": "Chooses whether Ready picks this number as a sender for texts and offers it as a caller ID. A switch left out keeps its value. One of the two must stay on. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The number id (phone_number_id from the purchase, or id from GET /v1/numbers)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "use_for_texting": {
                    "type": "boolean",
                    "description": "true or false. The strings \"true\"/\"false\" and 1/0 are also read; anything else is refused with toggle_invalid."
                  },
                  "use_for_calling": {
                    "type": "boolean",
                    "description": "true or false. The strings \"true\"/\"false\" and 1/0 are also read; anything else is refused with toggle_invalid."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "use_for_calling": {
                          "type": "integer",
                          "description": "1 or 0."
                        },
                        "use_for_texting": {
                          "type": "integer",
                          "description": "1 or 0."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "toggle_invalid",
          "calling_or_texting_required",
          "NUMBER_NOT_FOUND",
          "SETTING_SAVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/opt-outs": {
      "get": {
        "operationId": "optOuts.list",
        "tags": [
          "Opt-outs"
        ],
        "summary": "List opt-outs",
        "description": "The account's opted-out contacts, newest contact first, paged with before_id. Narrower than the single-number check unless scope=all, which lists opted-out contacts and then the whole ban list and pages with cursor and next_cursor instead. Loop on has_more, not on next_before_id (it is set on the last page too). Needs the view_contacts permission.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size. Default 100, max 500. An unreadable value uses the default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "description": "The next_before_id from the previous page (without scope).",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "all lists every number the send gate refuses on the account's own list: opted-out contacts (source contact) then the ban list (source ban_list). Page with cursor.",
            "schema": {
              "type": "string",
              "enum": [
                "all"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "With scope=all: the next_cursor from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "has_more"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/OptOutListItem"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "true while more pages remain. Loop until false."
                    },
                    "next_before_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Without scope: pass as before_id. null when the page is empty."
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "With scope=all, in place of next_before_id: pass as cursor. null on the last page."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_before_id",
          "invalid_scope",
          "invalid_cursor",
          "internal_error"
        ],
        "x-ready-pagination": {
          "style": "cursor",
          "cursorParam": "before_id",
          "nextCursorField": "next_before_id",
          "hasMoreField": "has_more",
          "itemsField": "data"
        },
        "x-ready-pagination-alt": {
          "when": "scope=all",
          "style": "cursor",
          "cursorParam": "cursor",
          "nextCursorField": "next_cursor",
          "hasMoreField": "has_more",
          "itemsField": "data"
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/opt-outs/{phone}": {
      "get": {
        "operationId": "optOuts.get",
        "tags": [
          "Opt-outs"
        ],
        "summary": "Check one number",
        "description": "Whether a number is opted out on your account, using the send gate's own answer, which also covers a deleted contact's STOP, a dialer do not call entry, the ban list and a STOP on another account of the agency. US and Canada (+1) only. A 500 means the check failed: do not text the number until it works.",
        "parameters": [
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "description": "The number, E.164 (URL-encode the + as %2B) or 10 digits.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/OptOutStatus"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_number",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/partner/clients": {
      "get": {
        "operationId": "partner.clients.list",
        "tags": [
          "Partner"
        ],
        "summary": "List your clients",
        "description": "The clients table of the Sub-accounts page: your sub-accounts with sends, replies, spend and registration for the last N days (days). Works for every agency, with or without the Partner program. Search with q by name, email, id or number.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Window in days. Default 30, at most 90.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 30
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Search text, up to 100 characters.",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Spend window start, a date. Send with until; at most 90 days apart.",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Spend window end, a date after since.",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/PartnerClientsList"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "not_agency_owner",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/partner/clients/{clientId}/consent-requests": {
      "post": {
        "operationId": "partner.clients.consentRequests.create",
        "tags": [
          "Partner"
        ],
        "summary": "Ask a client to accept your fees",
        "description": "Asks a client who has not accepted you setting their fees. They see it when they sign in and get an email at most once in 7 days; asking again while open sends a reminder inside that limit. Send no body fields.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "description": "The sub-account id.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/PartnerConsentRequest"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable",
          "unknown_field",
          "agreement_required",
          "partner_paused",
          "terms_check_unavailable",
          "already_accepted"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/partner/clients/{clientId}/fees": {
      "get": {
        "operationId": "partner.clients.fees.get",
        "tags": [
          "Partner"
        ],
        "summary": "Get a client's fees",
        "description": "A sub-account's current partner fees and their limits, in dollars. Read them before you set them. Needs an approved partner account.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "description": "The sub-account id.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/PartnerClientFees"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable"
        ]
      },
      "put": {
        "operationId": "partner.clients.fees.update",
        "tags": [
          "Partner"
        ],
        "summary": "Set a client's fees",
        "description": "Sets what a billing client sub-account pays, in dollars, to the values sent. A fee above Ready needs the client's consent, and a raise starts later; a cut bills at once. No fee can go under data.lowest or over data.ceiling. A billing agency sub-account always answers 404. Needs a live key.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "description": "The sub-account id.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerFeeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "changes": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PartnerFeeChange"
                          },
                          "description": "One per fee sent."
                        }
                      },
                      "required": [
                        "changes"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable",
          "fee_out_of_range",
          "coming_soon",
          "client_consent_required",
          "agreement_required",
          "partner_paused",
          "terms_check_unavailable",
          "price_moved"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/partner/default-fees": {
      "get": {
        "operationId": "partner.defaultFees.get",
        "tags": [
          "Partner"
        ],
        "summary": "Get your default fees",
        "description": "The fees new sub-accounts start with, beside Ready's fee for a new sub-account and the lowest each default may be. In dollars.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/PartnerDefaultFees"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable"
        ]
      },
      "put": {
        "operationId": "partner.defaultFees.update",
        "tags": [
          "Partner"
        ],
        "summary": "Set your default fees",
        "description": "Sets the fees every new client gets when they accept you. Sub-accounts already with you keep their fees unless you list them in apply_to_clients. Same fields and limits as Set a client's fees.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/PartnerFeeInput"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "apply_to_clients": {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "description": "Ids of current clients (from current_clients) to apply the changed defaults to."
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/PartnerDefaultFeesSaveResult"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable",
          "fee_out_of_range",
          "coming_soon",
          "agreement_required",
          "partner_paused",
          "terms_check_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/partner/invites": {
      "post": {
        "operationId": "partner.invites.create",
        "tags": [
          "Partner"
        ],
        "summary": "Invite a business",
        "description": "Emails a business your partner link, so a sign up from it becomes your client. One invite email per address every 7 days, plus a daily limit. A replay to the same address is refused with 429 email_cooldown. Needs the signed Partner Terms.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "business": {
                    "type": "string",
                    "description": "The business name.",
                    "maxLength": 120
                  },
                  "email": {
                    "type": "string",
                    "description": "Where to send the invite.",
                    "maxLength": 254
                  },
                  "person": {
                    "type": "string",
                    "description": "The name to greet. Left out, the email says \"Hi there\".",
                    "maxLength": 120
                  },
                  "snapshot": {
                    "type": "string",
                    "description": "The key of one of your snapshots to start the business with. Left out, your link snapshot is used.",
                    "maxLength": 64
                  },
                  "volume": {
                    "type": "string",
                    "description": "The texts a month you expect.",
                    "enum": [
                      "Just getting started",
                      "Under 10,000 a month",
                      "10,000 to 50,000 a month",
                      "50,000 to 250,000 a month",
                      "250,000 to 1,000,000 a month",
                      "Over 1,000,000 a month"
                    ]
                  },
                  "access": {
                    "type": "string",
                    "description": "The access the invite asks for.",
                    "enum": [
                      "none",
                      "account",
                      "agency"
                    ]
                  }
                },
                "required": [
                  "business",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "The invite id."
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable",
          "agreement_required",
          "partner_paused",
          "snapshot_not_found",
          "link_installs_one",
          "partner_is_sub_account",
          "silent_client",
          "email_unsubscribed",
          "email_cooldown",
          "daily_cap"
        ]
      },
      "get": {
        "operationId": "partner.invites.list",
        "tags": [
          "Partner"
        ],
        "summary": "List pending invites",
        "description": "Each address's newest invite that has not signed up as your client and was not cancelled, newest first, up to 500 addresses. Items sit at data.invites.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/PartnerInviteList"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/partner/invites/{id}/cancel": {
      "post": {
        "operationId": "partner.invites.cancel",
        "tags": [
          "Partner"
        ],
        "summary": "Cancel an invite",
        "description": "Cancels every open invite to that invite address. You can undo it for two minutes with restore. A second cancel answers canceled 0.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The invite id from the list.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "canceled": {
                          "type": "integer",
                          "description": "How many invites were cancelled."
                        }
                      },
                      "required": [
                        "canceled"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable",
          "invite_not_found"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/partner/invites/{id}/resend": {
      "post": {
        "operationId": "partner.invites.resend",
        "tags": [
          "Partner"
        ],
        "summary": "Resend an invite",
        "description": "Emails the same invite again, under the same 7 day and daily limits as a new invite.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The invite id from the list.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "The invite id."
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable",
          "agreement_required",
          "partner_paused",
          "invite_not_found",
          "silent_client",
          "email_unsubscribed",
          "email_cooldown",
          "daily_cap"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/partner/invites/{id}/restore": {
      "post": {
        "operationId": "partner.invites.restore",
        "tags": [
          "Partner"
        ],
        "summary": "Restore a cancelled invite",
        "description": "Reopens the invites to that invite address cancelled in the last two minutes. No email goes out. Answers restored 0 when nothing was cancelled recently, so calling it twice is safe.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The invite id from the list.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "restored": {
                          "type": "integer",
                          "description": "How many invites were restored."
                        }
                      },
                      "required": [
                        "restored"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable",
          "invite_not_found"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/partner/overview": {
      "get": {
        "operationId": "partner.overview.get",
        "tags": [
          "Partner"
        ],
        "summary": "Get the Partner overview",
        "description": "The Partner page in one read: you, your clients with their fees and status, partners you recruited, and daily earnings totals. Several time fields are UTC text with no zone, not ISO 8601. Answers 404 while the partner program is off.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/PartnerOverview"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "partner_program_off",
          "main_account_only",
          "not_a_partner",
          "account_check_unavailable",
          "partner_check_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/port-requests": {
      "get": {
        "operationId": "portRequests.list",
        "tags": [
          "Port requests"
        ],
        "summary": "List port-in requests",
        "description": "The account's latest 20 requests to move numbers from another carrier to Ready, newest first, in data.requests. Filing a request is only possible in the app, where the account holder signs the letter of authorization. The other keys under data feed the app's form and are unstable. Needs manage_phones.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "requests"
                      ],
                      "properties": {
                        "requests": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PortRequest"
                          }
                        },
                        "loa": {
                          "type": "object",
                          "description": "Unstable: the letter of authorization text the app shows.",
                          "properties": {
                            "version": {
                              "type": "string"
                            },
                            "text": {
                              "type": "string"
                            }
                          }
                        },
                        "max_numbers": {
                          "type": "integer",
                          "description": "Unstable: the most numbers one request can hold."
                        },
                        "max_lengths": {
                          "type": "object",
                          "description": "Unstable: the longest each form field may be."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "port_requests_load_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/port-requests/{id}/cancel": {
      "post": {
        "operationId": "portRequests.cancel",
        "tags": [
          "Port requests"
        ],
        "summary": "Cancel a port-in request",
        "description": "Cancels a request that is still submitted, before Ready files it with the carrier. A second call answers 409 not_cancellable. Needs manage_phones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "The port request id."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "not_cancellable",
          "port_request_cancel_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration": {
      "get": {
        "operationId": "registration.get",
        "tags": [
          "Registration"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Narrow data.registrations to entries whose name, company name or dba contains this text, ignoring case. data.brand, data.campaign and can_send_registered do not change.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Get registration status",
        "description": "The account's most recent brand and campaign, every brand and campaign on the account, and whether it can send at registered throughput. Check data.can_send_registered before sending; use status only to show progress. Unpaid and cancelled registrations are not shown.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/RegistrationStatus"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/brand": {
      "post": {
        "operationId": "registration.brand.create",
        "tags": [
          "Registration"
        ],
        "summary": "Register a brand",
        "description": "Registers the business and its first campaign in one call, and charges the first month (then monthly). With a card on file it charges at once; otherwise it answers a client_secret and payment_intent_id to finish with POST /v1/registration/confirm. After a timeout send the identical request again: it reuses the pending checkout and never charges twice. Does not take an Idempotency-Key. A test key only validates and creates nothing. Needs the manage_brands permission.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "company_name",
                  "ein",
                  "consent"
                ],
                "properties": {
                  "company_name": {
                    "type": "string",
                    "description": "Legal business name. Alias: business_name (send one of the two). Left out, the business name saved on the account is used; the call is refused when none is saved."
                  },
                  "business_name": {
                    "type": "string",
                    "description": "Alias of company_name."
                  },
                  "ein": {
                    "type": "string",
                    "description": "Tax id: 9 digits for a US business (47-2918563 or 472918563), or the company number for a business outside the US. Alias: reg_number. Cannot be changed later over the API."
                  },
                  "reg_number": {
                    "type": "string",
                    "description": "Alias of ein."
                  },
                  "consent": {
                    "type": "boolean",
                    "description": "Must be true: attests prior express written consent to text recipients. Alias: consent_program_attested."
                  },
                  "consent_program_attested": {
                    "type": "boolean",
                    "description": "Alias of consent."
                  },
                  "dba": {
                    "type": "string",
                    "description": "Doing business as name."
                  },
                  "entity_type": {
                    "type": "string",
                    "description": "PRIVATE_PROFIT (default), PUBLIC_PROFIT, NON_PROFIT or GOVERNMENT. An unknown value files as PRIVATE_PROFIT."
                  },
                  "industry": {
                    "type": "string",
                    "description": "Industry such as PROFESSIONAL_SERVICES, HEALTHCARE or REAL_ESTATE. An unknown value files as PROFESSIONAL_SERVICES."
                  },
                  "website": {
                    "type": "string",
                    "description": "Leave blank: Ready registers its hosted opt-in page."
                  },
                  "business_description": {
                    "type": "string",
                    "description": "One or two sentences on what the business does. Written for you when left out."
                  },
                  "street": {
                    "type": "string",
                    "description": "Business address. Optional for a US business, but if any address part is sent, send street, city, state and zip."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "State. Optional outside the US."
                  },
                  "zip": {
                    "type": "string",
                    "description": "ZIP or postal code."
                  },
                  "country": {
                    "type": "string",
                    "description": "Two-letter country code. Default US."
                  },
                  "email": {
                    "type": "string",
                    "description": "Contact email. Defaults to the account's."
                  },
                  "phone": {
                    "type": "string",
                    "description": "Contact phone. Defaults to the account's."
                  },
                  "first_name": {
                    "type": "string",
                    "description": "Contact first name."
                  },
                  "last_name": {
                    "type": "string",
                    "description": "Contact last name."
                  },
                  "campaign_name": {
                    "type": "string",
                    "description": "Name of the first campaign. Defaults to the business name."
                  },
                  "use_case": {
                    "type": "string",
                    "description": "Use case of the first campaign, one of GET /v1/registration/use-cases use_cases (case-insensitive). Default MIXED."
                  },
                  "campaign_description": {
                    "type": "string",
                    "description": "Leave blank: written from the use case and business name."
                  },
                  "number_choice": {
                    "type": "string",
                    "enum": [
                      "new",
                      "keep"
                    ],
                    "description": "new buys a number in preferred_area_code; keep uses a current number. Defaults to new when preferred_area_code is sent, else keep. Case-insensitive."
                  },
                  "preferred_area_code": {
                    "type": "string",
                    "description": "3-digit US area code to buy a new number in. The number is then billed monthly."
                  },
                  "phone_number_id": {
                    "type": "integer",
                    "description": "Which of your numbers to keep."
                  },
                  "transfer_confirm": {
                    "type": "boolean",
                    "description": "Send true after a 409 needs_transfer_confirm to move the number from its other brand."
                  },
                  "rush": {
                    "type": "boolean",
                    "default": false,
                    "description": "true buys Priority Registration and adds pricing_usd.priority to this charge. Test keys get 403 test_key_not_allowed."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/RegistrationCheckoutResult"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/Error"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "invalid_request",
          "invalid_use_case",
          "card_required",
          "duplicate_submission",
          "checkout_in_progress",
          "paid_not_filed",
          "payment_processing",
          "payment_unknown",
          "payments_unavailable",
          "checkout_failed",
          "registration_not_saved",
          "agency_setup",
          "user_not_found",
          "invalid_tax_id",
          "invalid_ein",
          "address_incomplete",
          "preferred_area_code_required",
          "consent_required",
          "ein_name_mismatch",
          "test_key_not_allowed",
          "duplicate_brand",
          "rejected_brand",
          "registration_number_selection_changed",
          "needs_transfer_confirm",
          "keep_number_missing",
          "keep_number_in_use",
          "keep_number_not_yours",
          "only_number_on_brand",
          "invalid_phone_number_id",
          "NUMBER_NOT_FOUND",
          "area_code_unavailable",
          "duplicate_check_unavailable",
          "number_check_unavailable",
          "transfer_check_unavailable",
          "availability_check_unavailable",
          "payment_check_unavailable",
          "exemption_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/campaign": {
      "post": {
        "operationId": "registration.campaign.create",
        "tags": [
          "Registration"
        ],
        "summary": "Add another campaign",
        "description": "Adds a campaign with a different use case under the account's brand. Refused with brand_required_first unless the account has a brand attempt that is not rejected. Without brand_id the campaign waits as awaiting_brand and is filed once a brand is approved. After a timeout send the identical request again: it is answered duplicate_use_case and never charges twice (GET /v1/registration shows what was filed). Does not take an Idempotency-Key. Needs the manage_brands permission.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "use_case"
                ],
                "properties": {
                  "use_case": {
                    "type": "string",
                    "description": "One of GET /v1/registration/use-cases use_cases, case-insensitive."
                  },
                  "use_cases": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "maxItems": 20,
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Optional list of up to 20 use cases to file, each from the same list. Defaults to use_case."
                  },
                  "campaign_name": {
                    "type": "string",
                    "description": "Campaign name. Default: <business name> Campaign."
                  },
                  "campaign_description": {
                    "type": "string",
                    "description": "Leave blank: written from the use case and business name. Alias: description."
                  },
                  "description": {
                    "type": "string",
                    "description": "Alias of campaign_description."
                  },
                  "brand_id": {
                    "type": "integer",
                    "description": "The brand's registration id. Send it when the brand is approved so the campaign goes straight to review."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/RegistrationCheckoutResult"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/Error"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "invalid_request",
          "invalid_use_case",
          "card_required",
          "duplicate_submission",
          "checkout_in_progress",
          "paid_not_filed",
          "payment_processing",
          "payment_unknown",
          "payments_unavailable",
          "checkout_failed",
          "registration_not_saved",
          "agency_setup",
          "user_not_found",
          "brand_required_first",
          "invalid_brand_id",
          "duplicate_use_case"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/confirm": {
      "post": {
        "operationId": "registration.confirm",
        "tags": [
          "Registration"
        ],
        "summary": "Confirm a registration payment",
        "description": "After the card payment behind a client_secret is confirmed, this files the registration now (otherwise Ready files it within a few minutes). Safe to call twice: a repeat answers already_processed. registration_id and type sit at the top level and under data. Needs the manage_brands permission.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payment_intent_id"
                ],
                "properties": {
                  "payment_intent_id": {
                    "type": "string",
                    "description": "The payment_intent_id from POST /v1/registration/brand or /campaign."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationConfirmResult"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/Error"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "payment_intent_id_required",
          "payment_processing",
          "payment_not_completed",
          "payment_owner_mismatch",
          "payment_not_found",
          "registration_not_found",
          "payment_refunded",
          "filing_failed",
          "payment_receipt_unavailable",
          "registration_claim_unconfirmed",
          "payment_check_unavailable",
          "payments_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/denied": {
      "get": {
        "operationId": "registration.denied.get",
        "tags": [
          "Registration"
        ],
        "summary": "Get the latest rejection (deprecated)",
        "description": "The account's latest rejected registration with the carrier reasons and an AI suggested fix, or {\"denied\": false}. Deprecated: GET /v1/registration carries the same rejection fields; answers carry a Deprecation header and a successor Link but it keeps working.",
        "deprecated": true,
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/RegistrationDenied"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "denied_status_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/optin-urls": {
      "get": {
        "operationId": "registration.optinUrls.list",
        "tags": [
          "Registration"
        ],
        "summary": "Get opt in page links",
        "description": "The public opt in page Ready hosts for each registration of the account: the page the carriers review and the link to share where people agree to get texts. A registration not paid yet has no page and is not listed. Not paginated.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RegistrationOptinUrl"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "INTERNAL_ERROR"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/throughput": {
      "get": {
        "operationId": "registration.throughput.get",
        "tags": [
          "Registration"
        ],
        "summary": "Get throughput",
        "description": "Live sending capacity: 24 hour volume and rejections, the daily cap and tier on the tmobile network, and warm-up state. A cached answer carries cached: true at the top level. It never returns a guessed all-clear: a read failure answers 503.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/RegistrationThroughput"
                    },
                    "cached": {
                      "type": "boolean",
                      "description": "true when the answer came from the short cache."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "throughput_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/use-cases": {
      "get": {
        "operationId": "registration.useCases.list",
        "tags": [
          "Registration"
        ],
        "summary": "Get registration requirements",
        "description": "Valid use cases, required fields, auto-filled fields, sample messages and this account's prices in dollars. Call this before registering. Read only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/RegistrationRequirements"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/{id}": {
      "delete": {
        "operationId": "registration.delete",
        "tags": [
          "Registration"
        ],
        "summary": "Cancel a registration",
        "description": "Cancels a registration that is not approved yet and stops its monthly fee. Cannot be undone and is not refunded. An approved one is turned off with POST /v1/registration/{id}/deregister instead. Needs the manage_brands permission and a key of the registration's own account (owner or admin) or its agency.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The Ready registration id (brand.id or campaign.id from GET /v1/registration), not a carrier id. Digits only.",
            "schema": {
              "type": "string",
              "pattern": "^0*[1-9][0-9]{0,9}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "refunded_cents": {
                      "type": "integer",
                      "description": "Present when part of a payment was refunded, in cents."
                    },
                    "data": {
                      "type": "object",
                      "description": "Present on a test key answer only."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "registration_approved",
          "owner_only",
          "registration_not_found",
          "registration_changed",
          "remove_failed",
          "subscription_cancel_failed",
          "scope_unavailable"
        ]
      },
      "patch": {
        "operationId": "registration.update",
        "tags": [
          "Registration"
        ],
        "summary": "Edit a registration",
        "description": "Changes a registration's details before it is filed with the carriers. Only the listed fields are forwarded; others are ignored. Once the carriers have it this answers 409; fix a rejected one with resubmit. Needs the manage_brands permission and a key of the registration's own account (owner or admin) or its agency.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The Ready registration id (brand.id or campaign.id from GET /v1/registration), not a carrier id. Digits only.",
            "schema": {
              "type": "string",
              "pattern": "^0*[1-9][0-9]{0,9}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Send one or more of these fields.",
                "properties": {
                  "company_name": {
                    "type": "string",
                    "description": "New company name."
                  },
                  "dba": {
                    "type": "string",
                    "description": "New dba."
                  },
                  "campaign_name": {
                    "type": "string",
                    "description": "New campaign name."
                  },
                  "campaign_description": {
                    "type": "string",
                    "description": "New campaign description."
                  },
                  "website": {
                    "type": "string",
                    "description": "New website."
                  },
                  "industry": {
                    "type": "string",
                    "description": "New industry."
                  },
                  "street": {
                    "type": "string",
                    "description": "New street."
                  },
                  "city": {
                    "type": "string",
                    "description": "New city."
                  },
                  "state": {
                    "type": "string",
                    "description": "New state."
                  },
                  "zip": {
                    "type": "string",
                    "description": "New zip."
                  },
                  "email": {
                    "type": "string",
                    "description": "New email."
                  },
                  "phone": {
                    "type": "string",
                    "description": "New phone."
                  },
                  "first_name": {
                    "type": "string",
                    "description": "New first name."
                  },
                  "last_name": {
                    "type": "string",
                    "description": "New last name."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "no_editable_fields",
          "owner_only",
          "registration_not_found",
          "registration_locked",
          "registration_rejected",
          "edit_failed",
          "scope_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/{id}/deregister": {
      "post": {
        "operationId": "registration.deregister",
        "tags": [
          "Registration"
        ],
        "summary": "Turn off a registration",
        "description": "Stops an approved brand or campaign at the carriers; its monthly fee is cancelled first, and if that fails nothing is turned off. dry_run defaults to true: call once to get data.name and data.numbers, then again with dry_run false and confirm_name. Numbers stay on the account. Send an Idempotency-Key so a retry gets the first answer. Needs the manage_brands permission and a key of the registration's own account (owner or admin) or its agency.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The Ready registration id (brand.id or campaign.id from GET /v1/registration), not a carrier id. Digits only.",
            "schema": {
              "type": "string",
              "pattern": "^0*[1-9][0-9]{0,9}$"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-ready-idempotent": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dry_run": {
                    "type": "boolean",
                    "default": true,
                    "description": "Left out or true changes nothing and answers data.name and data.numbers. false turns it off. Must be a JSON boolean."
                  },
                  "confirm_name": {
                    "type": "string",
                    "maxLength": 300,
                    "description": "Required with dry_run false: the data.name from the dry run, any case."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationDeregisterResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "invalid_field",
          "registration_not_approved",
          "confirm_name_mismatch",
          "nothing_to_deregister",
          "owner_only",
          "registration_not_found",
          "tcr_direct_registration",
          "protected_account",
          "deregister_failed",
          "subscription_cancel_failed",
          "deregister_partial"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/{id}/limits": {
      "get": {
        "operationId": "registration.limits.get",
        "tags": [
          "Registration"
        ],
        "summary": "Get a brand's carrier limits",
        "description": "The carrier assigned SMS limits for each campaign of one brand, 10 campaigns a page. They describe allowed capacity, not daily headroom; use GET /v1/registration/throughput for usage and warm-up. Includes unpaid and cancelled campaigns that GET /v1/registration hides.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The Ready brand registration id (data.brand.id from GET /v1/registration), not a carrier id or a campaign id.",
            "schema": {
              "type": "string",
              "pattern": "^0*[1-9][0-9]{0,9}$"
            }
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "description": "Return only this campaign registration under the brand.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "description": "Pagination cursor: the next_after_id from the previous page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/RegistrationCarrierLimits"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "registration_not_found",
          "throughput_unavailable"
        ],
        "x-ready-pagination": {
          "style": "cursor",
          "cursorParam": "after_id",
          "nextCursorField": "data.next_after_id",
          "hasMoreField": "data.has_more",
          "itemsField": "data.campaigns"
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/{id}/name": {
      "put": {
        "operationId": "registration.rename",
        "tags": [
          "Registration"
        ],
        "summary": "Rename a registration",
        "description": "Sets the dashboard label of a brand or campaign. Nothing changes with the carriers. Names over 80 characters are cut. The answer carries data.name and, for older callers, data.display_name. Needs the manage_brands permission.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The Ready registration id (brand.id or campaign.id from GET /v1/registration), not a carrier id. Digits only.",
            "schema": {
              "type": "string",
              "pattern": "^0*[1-9][0-9]{0,9}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The new label, up to 80 characters."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/RegistrationRename"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "name_required",
          "invalid_field",
          "registration_not_found",
          "rename_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/{id}/resubmit": {
      "post": {
        "operationId": "registration.resubmit",
        "tags": [
          "Registration"
        ],
        "summary": "Resubmit a rejected registration",
        "description": "Resubmits a rejected registration, optionally with corrected fields. It deregisters and re-registers with the carriers, so send an Idempotency-Key; the key is scoped to the body, so a different body with the same key is a new request. A 200 carries submit.status (resubmitted, filed_register_pending, already_approved, in_progress, waiting_for_brand or manual_fix). Read registration_id; reg_id is the older name. Needs the manage_brands permission.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The rejected registration's id.",
            "schema": {
              "type": "string",
              "pattern": "^0*[1-9][0-9]{0,9}$"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-ready-idempotent": true,
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fields": {
                    "type": "object",
                    "description": "Corrections. Only these keys apply: company_name, dba, ein, website, industry, entity_type, use_cases, campaign_description, street, city, state, zip, email, phone, first_name, last_name, country, sample_message_1, sample_message_2, optin_text, and ein_override (true submits a new EIN the IRS does not list yet). Others and empty strings are ignored. Each correction is up to 500 characters.",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationResubmitResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "invalid_id",
          "invalid_fix",
          "ein_name_mismatch",
          "not_rejected",
          "resubmit_unconfirmed",
          "carrier_refused",
          "missing_details",
          "missing_website",
          "not_saved",
          "not_sent",
          "state_changed",
          "protected_registration",
          "reconciliation_required",
          "compliance_review"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/{id}/transfer": {
      "put": {
        "operationId": "registration.transfer",
        "tags": [
          "Registration"
        ],
        "summary": "Move a registration to a sub-account",
        "description": "Moves a registration and the rest of its brand (and, with move_numbers, the numbers on its campaigns) to a sub-account directly under the caller. No charge; fees do not change; it cannot be moved back over the API. Once moved, a repeat answers 404, so a retry never moves it twice. This /v1 route does not forward dry_run, so it always moves. Test keys are refused. Needs the manage_brands permission.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The registration id, a brand or a campaign.",
            "schema": {
              "type": "string",
              "pattern": "^0*[1-9][0-9]{0,9}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_user_id": {
                    "type": "integer",
                    "description": "The sub-account's id from GET /v1/sub-accounts. Send this or target_account_name."
                  },
                  "target_account_name": {
                    "type": "string",
                    "description": "The sub-account's exact company name (case aside)."
                  },
                  "move_numbers": {
                    "type": "boolean",
                    "description": "true also moves the numbers on these campaigns. Left out, they stay."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/RegistrationTransferResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "target_required",
          "owner_only",
          "test_key_not_allowed",
          "registration_not_found",
          "target_not_found",
          "target_not_exact",
          "target_ambiguous",
          "registration_changed",
          "rate_limited",
          "transfer_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/{id}/vet": {
      "post": {
        "operationId": "registration.vet.create",
        "tags": [
          "Registration"
        ],
        "summary": "Vet a brand",
        "description": "Buys external vetting for a brand, which raises its carrier score and throughput. Paid once; ENHANCED on a brand already vetted STANDARD is an upgrade that costs the difference. Fields come back at the top level, not under data. With a client_secret, confirm the card in the app, then call POST /v1/registration/{id}/vet/confirm. A 202 with success false means the payment has not settled: do not pay again. Does not take an Idempotency-Key. Needs the manage_brands permission.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The brand's registration id.",
            "schema": {
              "type": "string",
              "pattern": "^0*[1-9][0-9]{0,9}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vetting_type": {
                    "type": "string",
                    "enum": [
                      "STANDARD",
                      "ENHANCED"
                    ],
                    "default": "STANDARD",
                    "description": "Vetting level, case-insensitive."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationVetResult"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/Error"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "not_a_brand_registration",
          "brand_not_linked_to_carrier",
          "reg_not_found",
          "brand_unavailable",
          "stripe_not_configured",
          "payment_processing",
          "vet_failed_charge_refunded",
          "vet_failed_charge_refund_failed",
          "vet_dispatch_pending",
          "invalid_vetting_type",
          "card_required",
          "already_vetted",
          "recent_vet",
          "registration_inactive",
          "needs_card",
          "needs_card_authentication",
          "payment_pending",
          "vet_failed",
          "checkout_failed",
          "payment_unknown",
          "registration_unavailable",
          "exemption_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/registration/{id}/vet/confirm": {
      "post": {
        "operationId": "registration.vet.confirm",
        "tags": [
          "Registration"
        ],
        "summary": "Confirm the vetting payment",
        "description": "Applies the vetting after a client_secret payment. Safe to call twice: a repeat answers already_processed. Fields come back at the top level. Needs the manage_brands permission.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The brand's registration id.",
            "schema": {
              "type": "string",
              "pattern": "^0*[1-9][0-9]{0,9}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payment_intent_id"
                ],
                "properties": {
                  "payment_intent_id": {
                    "type": "string",
                    "description": "The payment_intent_id from POST /v1/registration/{id}/vet."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrationVetConfirmResult"
                }
              }
            }
          },
          "202": {
            "$ref": "#/components/responses/Error"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_id",
          "not_a_brand_registration",
          "brand_not_linked_to_carrier",
          "reg_not_found",
          "brand_unavailable",
          "stripe_not_configured",
          "payment_processing",
          "vet_failed_charge_refunded",
          "vet_failed_charge_refund_failed",
          "vet_dispatch_pending",
          "payment_intent_id_required",
          "payment_intent_required",
          "payment_amount_mismatch",
          "invalid_vetting_type_in_pi_metadata",
          "payment_intent_mismatch",
          "payment_not_succeeded",
          "could_not_retrieve_payment_intent",
          "payment_refunded",
          "payment_receipt_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/calls": {
      "get": {
        "operationId": "reports.calls.summary",
        "tags": [
          "Reports"
        ],
        "summary": "Call totals",
        "description": "Dialer totals for a period, as the Calls tab of Reports shows them. A key user limited to assigned contacts gets the calls they placed or answered and the calls to their own and unassigned leads. The 503 report_unavailable carries retryable: true. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,4}$"
            },
            "description": "The last N days, a whole number. Default 30 (see docs)."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "First day, YYYY-MM-DD, in the key user's time zone. Whole days instead of days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Last day, YYYY-MM-DD, included."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ReportCallsSummary"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/calls/by-line": {
      "get": {
        "operationId": "reports.calls.byLine",
        "tags": [
          "Reports"
        ],
        "summary": "Calls by line",
        "description": "One row per calling number that placed calls, busiest first, up to 200, with per outcome counts. scope sits beside data. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,4}$"
            },
            "description": "The last N days, a whole number. Default 30 (see docs)."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "First day, YYYY-MM-DD, in the key user's time zone. Whole days instead of days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Last day, YYYY-MM-DD, included."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "scope"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportCallsLine"
                      }
                    },
                    "scope": {
                      "type": "string",
                      "description": "team, or rep when only the key user's visible calls are counted. Sits beside data."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/calls/by-rep": {
      "get": {
        "operationId": "reports.calls.byRep",
        "tags": [
          "Reports"
        ],
        "summary": "Calls by rep",
        "description": "One row per rep who placed calls, busiest first, up to 200. scope sits beside data, not inside it. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,4}$"
            },
            "description": "The last N days, a whole number. Default 30 (see docs)."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "First day, YYYY-MM-DD, in the key user's time zone. Whole days instead of days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Last day, YYYY-MM-DD, included."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "scope"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportCallsRep"
                      }
                    },
                    "scope": {
                      "type": "string",
                      "description": "team, or rep when only the key user's visible calls are counted. Sits beside data."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/calls/daily": {
      "get": {
        "operationId": "reports.calls.daily",
        "tags": [
          "Reports"
        ],
        "summary": "Calls by day",
        "description": "Calls placed and conversations for each day that had calls, oldest first, in the key user's time zone. Days with no calls are left out. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,4}$"
            },
            "description": "The last N days, a whole number. Default 30 (see docs)."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "First day, YYYY-MM-DD, in the key user's time zone. Whole days instead of days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Last day, YYYY-MM-DD, included."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportCallsDay"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/calls/list": {
      "get": {
        "operationId": "reports.calls.list",
        "tags": [
          "Reports"
        ],
        "summary": "Call list",
        "description": "The calls behind the call report tables, a page at a time, newest first by default. Paging is by page number from 0, up to page 400; read hasMore (camelCase) to know when to stop, and capped appears when the window has more calls than 400 pages reach. A slow search answers 503 search_too_slow; narrow the window. For full call objects with transcripts use GET /v1/calls. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,4}$"
            },
            "description": "The last N days, a whole number. Default 30 (see docs)."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "First day, YYYY-MM-DD, in the key user's time zone. Whole days instead of days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Last day, YYYY-MM-DD, included."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,3}$"
            },
            "description": "The page to read, from 0. Pages past 400 read page 400."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,3}$"
            },
            "description": "Calls per page, default 25, up to 100."
          },
          {
            "name": "outcome",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "interested",
                "callback",
                "not_interested",
                "voicemail",
                "no_answer",
                "wrong_number",
                "dq",
                "answered",
                "screened",
                "none",
                "other"
              ]
            },
            "description": "Only calls with this outcome bucket."
          },
          {
            "name": "result",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "answered",
                "voicemail",
                "screened",
                "no_answer",
                "unknown"
              ]
            },
            "description": "Only calls with this server verdict. Not in the docs."
          },
          {
            "name": "rep",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^(?:-1|\\d{1,10})$"
            },
            "description": "Only calls placed by this rep_id. -1 matches no one."
          },
          {
            "name": "from_number",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\+?\\d{3,20}$"
            },
            "description": "Only calls placed from this number, as in calls by line."
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "Text matches the contact's or the rep's name; digits match the number called."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "time-desc",
                "time-asc",
                "duration-desc",
                "contact-asc",
                "rep-asc"
              ]
            },
            "description": "Sort order, default time-desc. Not in the docs."
          },
          {
            "name": "new_leads",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "0",
                "1",
                "true",
                "false"
              ]
            },
            "description": "1 or true: only calls to leads created in the window. Not in the docs."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "page",
                    "hasMore"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportCallRow"
                      }
                    },
                    "page": {
                      "type": "integer",
                      "description": "The page returned."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "true when a later page has calls."
                    },
                    "capped": {
                      "type": "boolean",
                      "description": "Present and true only at page 400 when more calls are left than 400 pages reach."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-pagination": {
          "style": "page",
          "pageParam": "page",
          "limitParam": "limit",
          "hasMoreField": "hasMore",
          "cappedField": "capped",
          "itemsField": "data"
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable",
          "search_too_slow"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/calls/outcomes": {
      "get": {
        "operationId": "reports.calls.outcomes",
        "tags": [
          "Reports"
        ],
        "summary": "Calls by outcome",
        "description": "How many calls ended in each outcome. Every outcome key is in the answer, so the counts add up to dials. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{1,4}$"
            },
            "description": "The last N days, a whole number. Default 30 (see docs)."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "First day, YYYY-MM-DD, in the key user's time zone. Whole days instead of days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Last day, YYYY-MM-DD, included."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ReportCallsOutcomes"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/daily": {
      "get": {
        "operationId": "reports.daily",
        "tags": [
          "Reports"
        ],
        "summary": "Daily report",
        "description": "One row per calendar day for one account (no sub-accounts) in the account's time zone, oldest first, with zero rows for quiet days. Costs are decimal dollar strings net of refunds. Only from, to, days and timezone are accepted; any other parameter is a 400 invalid_report_range. A key user limited to assigned contacts gets 403 report_scope_forbidden; X-Sub-Account-Id needs team management (403 sub_account_forbidden). Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "First day, YYYY-MM-DD. Send with to."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Last day, YYYY-MM-DD, included. Today at the latest."
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[1-9]\\d*$"
            },
            "description": "The last N days, today included, 1 to 93 (default 30). Use days or from and to, not both."
          },
          {
            "name": "timezone",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "An IANA name such as America/New_York or UTC. Default: the account's time zone."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDaily"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_report_range",
          "sub_account_forbidden",
          "report_scope_forbidden",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/deliverability": {
      "get": {
        "operationId": "reports.deliverability",
        "tags": [
          "Reports"
        ],
        "summary": "Deliverability",
        "description": "Why texts fail: summaries for 24 hours, 7 and 30 days, failures by group, the top errors with advice, per number and per carrier results and the latest failures, refreshed every few minutes. The fields sit at the top level, not under data. numbers_only=true (or 1) answers only per_phone with health fields. Key users limited to assigned contacts, or a team member limited to some numbers (full report only), get 403 report_scope_forbidden. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "numbers_only",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 8
            },
            "description": "true or 1 to get only per_phone, faster."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDeliverability"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable",
          "report_scope_forbidden"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/delivery-breakdown": {
      "get": {
        "operationId": "reports.deliveryBreakdown",
        "tags": [
          "Reports"
        ],
        "summary": "Delivery breakdown",
        "description": "Did the texts arrive: totals, a daily trend, failure reasons and the result per sending number. part reads less to answer faster: summary, numbers, reasons, detail (numbers and reasons) or all (default; any other value reads all). A part not asked for comes back null, except daily, which is an empty list. With part=reasons and the reasons unreadable, the answer is 503 FAILURE_REASONS_UNAVAILABLE with retryable: true. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "The last N days, a whole number. Default 30 (see docs). Ignored when from or to is sent."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "Start of a custom window instead of days: YYYY-MM-DD for whole days in the key user's time zone, or a full ISO 8601 time."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "End of the custom window: YYYY-MM-DD (that day included) or a full ISO 8601 time."
          },
          {
            "name": "part",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 16
            },
            "description": "summary, numbers, reasons, detail or all. Default all."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ReportDeliveryBreakdown"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable",
          "FAILURE_REASONS_UNAVAILABLE"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/hourly": {
      "get": {
        "operationId": "reports.hourly",
        "tags": [
          "Reports"
        ],
        "summary": "Texts by hour",
        "description": "Texts sent and delivered in each UTC clock hour of one window of up to 48 hours, oldest first; hours with no texts are left out. from is required. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "Start of the window, an ISO timestamp.",
            "required": true
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "End of the window, exclusive, ISO. Default now. At most 48 hours after from."
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "Accepted by the validator but not used by this report."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportHourlyRow"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/hourly-pattern": {
      "get": {
        "operationId": "reports.hourlyPattern",
        "tags": [
          "Reports"
        ],
        "summary": "Best hours to send",
        "description": "Texts sent and replies for each hour of the day (always 24 rows), over the last N times 24 hours. Counts only the key's own account, not sub-accounts. A key user limited to assigned contacts gets 403 report_scope_forbidden. best and timezone sit beside data. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "The last N days, up to 365. Default 30 (see docs)."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "Accepted by the validator but not used by this report."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "Accepted by the validator but not used by this report."
          },
          {
            "name": "tz",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "An IANA time zone such as America/New_York. Default: the key user's time zone. An unknown name is ignored."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "timezone"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportHourlyPatternRow"
                      }
                    },
                    "best": {
                      "$ref": "#/components/schemas/ReportSendWindow"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "The time zone the hours are counted in."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable",
          "report_scope_forbidden"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/overview": {
      "get": {
        "operationId": "reports.overview",
        "tags": [
          "Reports"
        ],
        "summary": "Overview totals",
        "description": "The totals the Reports page shows for a period: sent, delivered, failed, replies, opt-outs and spend, over the account and its sub-accounts. Days start at midnight in the key user's time zone; days=1 means the last 24 hours. Spend fields are null on a sub-account its agency pays for. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "The last N days, a whole number. Default 30 (see docs). Ignored when from or to is sent."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "Start of a custom window instead of days: YYYY-MM-DD for whole days in the key user's time zone, or a full ISO 8601 time."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "End of the custom window: YYYY-MM-DD (that day included) or a full ISO 8601 time."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ReportOverview"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/reply-heatmap": {
      "get": {
        "operationId": "reports.replyHeatmap",
        "tags": [
          "Reports"
        ],
        "summary": "Reply heatmap",
        "description": "How many replies arrived in each hour of each weekday; slots with no replies are left out. It counts replies, not a reply rate. timezone sits beside data. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "The last N days, a whole number. Default 30 (see docs). Ignored when from or to is sent."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "Start of a custom window instead of days: YYYY-MM-DD for whole days in the key user's time zone, or a full ISO 8601 time."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "End of the custom window: YYYY-MM-DD (that day included) or a full ISO 8601 time."
          },
          {
            "name": "tz",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "An IANA time zone such as America/New_York. Default: the key user's time zone. An unknown name is ignored."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "timezone"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportHeatmapCell"
                      }
                    },
                    "timezone": {
                      "type": "string",
                      "description": "The time zone the slots are counted in."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/top-campaigns": {
      "get": {
        "operationId": "reports.topCampaigns",
        "tags": [
          "Reports"
        ],
        "summary": "Top campaigns",
        "description": "The campaigns and drip campaigns that sent the most in the window, largest first, across the account and its sub-accounts. A campaign with no sends in the window is left out; see docs for how many are shown. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "The last N days, a whole number. Default 30 (see docs). Ignored when from or to is sent."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "Start of a custom window instead of days: YYYY-MM-DD for whole days in the key user's time zone, or a full ISO 8601 time."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "End of the custom window: YYYY-MM-DD (that day included) or a full ISO 8601 time."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportTopCampaign"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/reports/volume": {
      "get": {
        "operationId": "reports.volume",
        "tags": [
          "Reports"
        ],
        "summary": "Daily text volume",
        "description": "Texts sent and delivered per day, oldest first, in the key user's time zone, across the account and its sub-accounts, MMS and failed texts included. Defaults to the last 15 days. Use the daily report for costs, replies and opt-outs. Can answer 429 report_busy with Retry-After when too many of the account's report requests are already waiting; wait and retry, do not record zeros.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            },
            "description": "The last N days. Default 15."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "Start of a custom window instead of days: YYYY-MM-DD for whole days in the key user's time zone, or a full ISO 8601 time."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "End of the custom window: YYYY-MM-DD (that day included) or a full ISO 8601 time."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportVolumeDay"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "permission_denied",
          "report_busy",
          "report_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/scrub": {
      "post": {
        "operationId": "scrub.create",
        "tags": [
          "Opt-outs"
        ],
        "summary": "Scrub numbers",
        "description": "Checks 1 to 1,000 US numbers against the TCPA litigator and Do Not Call complainer lists, plus the federal and state Do Not Call lists when the account screens them. Each valid unique number is billed at the account's scrub rate; invalid numbers are not. Per-number problems come back inside results with error_code, not as an HTTP error. A batch can take over a minute: on a timeout retry with the same Idempotency-Key. Needs the edit_contacts permission.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-ready-idempotent": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "phones"
                ],
                "properties": {
                  "phones": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1000,
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 1,000 US numbers, E.164 or 10 digits."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ScrubBatch"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "too_many_numbers",
          "insufficient_balance",
          "client_card_required",
          "not_found",
          "internal_error",
          "tcpa_not_configured"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/scrub/{phone}": {
      "get": {
        "operationId": "scrub.get",
        "tags": [
          "Opt-outs"
        ],
        "summary": "Scrub one number",
        "description": "The same check for one number. This GET is billed at the scrub rate; send an Idempotency-Key so a retry replays the first answer instead of billing again. A number that cannot be checked answers 200 with the problem in data.error_code (insufficient_balance during the call also comes this way), so check data.error_code first. Deprecated in favour of POST /v1/scrub with one number but still supported. Needs the edit_contacts permission; a view only session gets 403 READ_ONLY_SESSION.",
        "deprecated": true,
        "parameters": [
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "description": "A US number, E.164 or 10 digits.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ScrubResult"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "READ_ONLY_SESSION",
          "insufficient_balance",
          "client_card_required",
          "not_found",
          "internal_error",
          "tcpa_not_configured"
        ],
        "x-ready-idempotent": true
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/sip-trunk": {
      "get": {
        "operationId": "sipTrunk.get",
        "tags": [
          "SIP trunk"
        ],
        "summary": "Read your SIP trunk",
        "description": "The account's SIP trunk settings and the numbers that ring it. SIP trunking is switched on per account by support; without it the answer is just available: false. Needs no permission beyond access to the account. Which numbers ring the trunk is set per number with PUT /v1/numbers/{id}/forwarding calls_to sip.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/SipTrunk"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "internal_error"
        ]
      },
      "put": {
        "operationId": "sipTrunk.update",
        "tags": [
          "SIP trunk"
        ],
        "summary": "Turn on or change your SIP trunk",
        "description": "Sets up the account's one SIP trunk, or changes its SBC settings, and returns the same body as the GET. Needs manage_phones. Safe to repeat. Calls your SBC places are billed per minute at your calling rate.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sbc_ip": {
                    "type": "string",
                    "maxLength": 15,
                    "description": "Your SBC's public IPv4 address. Private and local addresses are refused."
                  },
                  "sbc_port": {
                    "type": [
                      "integer",
                      "string"
                    ],
                    "description": "Your SBC's SIP port, 1025 to 65535. Most use 5060."
                  },
                  "codecs": {
                    "type": "array",
                    "maxItems": 3,
                    "items": {
                      "type": "string",
                      "enum": [
                        "PCMU",
                        "PCMA",
                        "G729"
                      ]
                    },
                    "description": "One or more of PCMU, PCMA, G729 (case is ignored)."
                  }
                },
                "required": [
                  "sbc_ip",
                  "sbc_port",
                  "codecs"
                ]
              },
              "example": {
                "sbc_ip": "203.0.113.10",
                "sbc_port": 5060,
                "codecs": [
                  "PCMU",
                  "PCMA"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/SipTrunk"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "SIP_TRUNKING_UNAVAILABLE",
          "permission_denied",
          "SIP_TRUNK_SBC_IN_USE",
          "SIP_TRUNK_CARRIER_FAILED",
          "SIP_TRUNK_BUSY",
          "internal_error"
        ]
      },
      "delete": {
        "operationId": "sipTrunk.delete",
        "tags": [
          "SIP trunk"
        ],
        "summary": "Turn off your SIP trunk",
        "description": "Every number on the trunk goes back to no forwarding, then the trunk is removed. Works without the SIP trunking flag, so an account can always get out. Needs manage_phones. Safe to repeat: a second call answers deleted: false.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "description": "true when a trunk was turned off."
                        }
                      },
                      "required": [
                        "deleted"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "permission_denied",
          "SIP_TRUNK_CARRIER_FAILED",
          "SIP_TRUNK_BUSY",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/smart-routing": {
      "get": {
        "operationId": "smartRouting.get",
        "tags": [
          "Number health"
        ],
        "summary": "Get Smart delivery",
        "description": "Whether a text moves to another of the account's numbers when its own number is delivering badly. On unless turned off.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "enabled"
                      ],
                      "properties": {
                        "enabled": {
                          "type": "boolean",
                          "description": "The setting now."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "SETTING_LOAD_FAILED"
        ]
      },
      "put": {
        "operationId": "smartRouting.update",
        "tags": [
          "Number health"
        ],
        "summary": "Turn Smart delivery on or off",
        "description": "Turns Smart delivery on or off for the account. It only moves texts between numbers you already have, so it costs nothing. Needs manage_phones.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "true or false. The strings \"true\"/\"false\" and 1/0 are also read; anything else is refused with toggle_invalid."
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "enabled"
                      ],
                      "properties": {
                        "enabled": {
                          "type": "boolean",
                          "description": "The setting now."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "toggle_invalid",
          "SETTING_SAVE_UNCONFIRMED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/sms-protection": {
      "get": {
        "operationId": "smsProtection.get",
        "tags": [
          "Number health"
        ],
        "summary": "Get number protection",
        "description": "Whether Ready replaces a spam-flagged sending number automatically. A replacement is a new number with its own monthly fee, so turning it on is done by the account holder in the app; there is no API to change it.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/SmsProtection"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "SETTING_LOAD_FAILED"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/snapshots": {
      "get": {
        "operationId": "snapshots.list",
        "tags": [
          "Snapshots"
        ],
        "summary": "List your snapshots",
        "description": "The snapshots your account made, newest first, with the share key POST /v1/snapshots/apply takes. Needs manage_campaigns.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Snapshot"
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "permission_denied",
          "request_failed"
        ]
      },
      "post": {
        "operationId": "snapshots.create",
        "tags": [
          "Snapshots"
        ],
        "summary": "Create a snapshot",
        "description": "Packs the items you pick into a new snapshot and returns its share key. It reads only your own items and changes nothing in the account. Sending it again makes a second snapshot with a new key. Refusals carry request_failed with a reason field (nothing_picked, items_gone, not_your_account). Needs manage_campaigns.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "description": "A name, default \"My setup\".",
                    "maxLength": 80
                  },
                  "account": {
                    "type": "integer",
                    "description": "Take the items from this sub-account instead of your own. The snapshot is still yours.",
                    "minimum": 1,
                    "maximum": 2147483647
                  },
                  "automations": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Automation ids."
                  },
                  "templates": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Template ids."
                  },
                  "drips": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Drip campaign ids."
                  },
                  "campaigns": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Campaign ids."
                  },
                  "pipelines": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Contact pipeline ids."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/SnapshotCreated"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "unknown_field",
          "request_failed",
          "permission_denied"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/snapshots/apply": {
      "post": {
        "operationId": "snapshots.apply",
        "tags": [
          "Snapshots"
        ],
        "summary": "Install a snapshot",
        "description": "Installs a snapshot (templates, drip campaigns, automations, campaigns, lists, custom fields and pipelines), matched by name so nothing is added twice. Automations arrive off; drips and campaigns arrive as drafts. With X-Sub-Account-Id it installs into that sub-account. On 500 IMPORT_PARTIAL the body carries data.failed; send the same request again. Needs manage_campaigns.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "The snapshot share key."
                  }
                },
                "required": [
                  "key"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/SnapshotApplyResult"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "unknown_field",
          "OWN_SNAPSHOT",
          "permission_denied",
          "SNAPSHOT_NOT_FOUND",
          "SNAPSHOT_DAMAGED",
          "IMPORT_PARTIAL",
          "IMPORT_RETRY"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/sub-accounts": {
      "post": {
        "operationId": "subAccounts.create",
        "tags": [
          "Sub-accounts"
        ],
        "summary": "Create a sub-account",
        "description": "Creates a sub-account with its own login, card, numbers and registration. With an owner email it answers 200 with an invite_link; with billing agency and no email it makes a workspace you run yourself and answers 201. Treat any 2xx as created. Idempotency-Key is honoured only for the create without email; a repeat for the same email answers 409 client_already_yours. Needs invite_team (and manage_campaigns with ghl_location_id).",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Owner email, up to 254 characters. Required unless billing is agency.",
                    "maxLength": 254
                  },
                  "first_name": {
                    "type": "string",
                    "description": "Up to 120 characters.",
                    "maxLength": 120
                  },
                  "last_name": {
                    "type": "string",
                    "description": "Up to 120 characters.",
                    "maxLength": 120
                  },
                  "company_name": {
                    "type": "string",
                    "description": "Up to 120 characters. Required when email is left out.",
                    "maxLength": 120
                  },
                  "send_invite": {
                    "type": "boolean",
                    "description": "Default true. false skips the invite email; send invite_link yourself."
                  },
                  "billing": {
                    "type": "string",
                    "description": "Default client: the sub-account pays its own way (needs the Partner Terms accepted in the app). agency: you pay. Cannot be changed later through the API.",
                    "enum": [
                      "client",
                      "agency"
                    ]
                  },
                  "accept_partner_terms": {
                    "type": "boolean",
                    "description": "Accepted for compatibility; the Partner Terms are accepted only in the app, so true answers 403 partner_terms_browser_only."
                  },
                  "ghl_location_id": {
                    "type": "string",
                    "description": "A GoHighLevel location waiting to be linked, linked to the new sub-account in the same call.",
                    "maxLength": 64,
                    "pattern": "^[A-Za-z0-9_-]+$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created a sub-account with an owner email (also a test key answer).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/SubAccountCreateResult"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Created a workspace you run yourself (no email).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/SubAccountCreateResult"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "unknown_field",
          "agency_only",
          "INVITER_NOT_ADMIN",
          "partner_terms_browser_only",
          "partner_terms_required",
          "white_label_pays_for_clients",
          "location_not_linkable",
          "client_already_yours",
          "email_has_account",
          "link_requested",
          "email_reserved",
          "AGENCY_UNVERIFIED",
          "internal_error"
        ],
        "x-ready-idempotent": true
      },
      "get": {
        "operationId": "subAccounts.list",
        "tags": [
          "Sub-accounts"
        ],
        "summary": "List sub-accounts",
        "description": "The sub-accounts you manage and your own business accounts, newest first. Pages with before_id. Needs invite_team.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size. Default 50, max 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "before_id",
            "in": "query",
            "required": false,
            "description": "The next_before_id from the previous page.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SubAccount"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "true when another page follows."
                    },
                    "next_before_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Pass as before_id. null on an empty page."
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "has_more",
                    "next_before_id"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "internal_error"
        ],
        "x-ready-pagination": {
          "style": "cursor",
          "cursorParam": "before_id",
          "nextCursorField": "next_before_id",
          "hasMoreField": "has_more",
          "itemsField": "data"
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/sub-accounts/{id}": {
      "get": {
        "operationId": "subAccounts.get",
        "tags": [
          "Sub-accounts"
        ],
        "summary": "Get a sub-account",
        "description": "One sub-account, as the list returns it, including your own business accounts. Needs invite_team.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The sub-account id.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/SubAccount"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "sub_account_not_found",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/sub-accounts/{id}/rate": {
      "put": {
        "operationId": "subAccounts.rate.update",
        "tags": [
          "Sub-accounts"
        ],
        "summary": "Clear a legacy markup (older path)",
        "description": "Only clears a sub-account legacy markup: send markup 0, or use_default true when your default is 0. A markup above 0 is refused with markup_retired, except on a sub-account you pay for, where it is the price you bill that client yourself. Use partner fees instead. Needs invite_team.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The sub-account id.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "markup": {
                    "type": "number",
                    "description": "Per segment markup in dollars. Only 0 is accepted on a client that pays Ready itself.",
                    "minimum": 0
                  },
                  "dialer_markup": {
                    "type": "number",
                    "description": "Call markup in dollars per billed minute.",
                    "minimum": 0
                  },
                  "use_default": {
                    "type": "boolean",
                    "description": "Use your default markup."
                  },
                  "use_default_dialer": {
                    "type": "boolean",
                    "description": "Use your default call markup."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/SubAccountRateResult"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "unknown_field",
          "markup_retired",
          "under_ready",
          "over_ceiling",
          "invalid_markup",
          "forbidden",
          "terms_required",
          "reseller_not_approved",
          "sub_account_not_found",
          "rate_locked",
          "tracked_balance",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/sub-accounts/{id}/sharing": {
      "put": {
        "operationId": "subAccounts.sharing.update",
        "tags": [
          "Sub-accounts"
        ],
        "summary": "Set capacity sharing",
        "description": "Whether a sub-account texts under your registration, and how many texts a day it may send there. Send at least one field. shares_owner_capacity is saved but not enforced yet; a daily limit binds at once. Needs invite_team.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The sub-account id.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shares_owner_capacity": {
                    "type": "boolean",
                    "description": "Whether it texts under your registration."
                  },
                  "shared_daily_limit": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Texts a day on all carriers, 1 to 10,000,000. null or 0 removes the limit."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/SubAccount"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "unknown_field",
          "organization_only",
          "sub_account_not_found",
          "not_a_sharing_sub_account",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/team-members": {
      "post": {
        "operationId": "teamMembers.create",
        "tags": [
          "Team Members"
        ],
        "summary": "Add a team member",
        "description": "Adds a person to the team with their own login and an invite email. With X-Sub-Account-Id it is that sub-account team. role defaults to member. A repeat for an email already on the team answers 400 already_on_team. Needs invite_team.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Their login email, up to 254 characters.",
                    "maxLength": 254
                  },
                  "first_name": {
                    "type": "string",
                    "description": "Up to 120 characters.",
                    "maxLength": 120
                  },
                  "last_name": {
                    "type": "string",
                    "description": "Up to 120 characters.",
                    "maxLength": 120
                  },
                  "role": {
                    "type": "string",
                    "description": "Default member. admin: everything. member: send and work contacts. viewer: read only. agent: member who uses the dialer (needs a free seat). manager: older name for member.",
                    "enum": [
                      "admin",
                      "member",
                      "manager",
                      "agent",
                      "viewer"
                    ]
                  },
                  "sub_account_access": {
                    "type": "string",
                    "description": "all or organization_only. Left out, Ready picks it as the Team page does.",
                    "enum": [
                      "all",
                      "organization_only"
                    ]
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Test key answer; nothing was added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/TeamMemberCreateResult"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/TeamMemberCreateResult"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "unknown_field",
          "invalid_role",
          "already_on_team",
          "permission_grant_exceeds_your_own",
          "sub_account_forbidden",
          "forbidden",
          "permission_denied",
          "conflict",
          "internal_error"
        ]
      },
      "get": {
        "operationId": "teamMembers.list",
        "tags": [
          "Team Members"
        ],
        "summary": "List team members",
        "description": "The people on the team, newest first, as the Team page lists them, in one page. Sub-accounts are not in it. With X-Sub-Account-Id it is that sub-account team. Needs invite_team.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TeamMember"
                      }
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "permission_denied",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/team-members/{id}": {
      "put": {
        "operationId": "teamMembers.update",
        "tags": [
          "Team Members"
        ],
        "summary": "Update a team member",
        "description": "Changes a person's name, role or sub-account access; send only what you want to change, at least one field. A role change signs them out. Email cannot be changed with an API key. Needs invite_team.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Their id from List team members.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": "string",
                    "description": "Up to 120 characters.",
                    "maxLength": 120
                  },
                  "last_name": {
                    "type": "string",
                    "description": "Up to 120 characters.",
                    "maxLength": 120
                  },
                  "role": {
                    "type": "string",
                    "description": "The same roles as Add a team member. agent needs a free dialer seat.",
                    "enum": [
                      "admin",
                      "member",
                      "manager",
                      "agent",
                      "viewer"
                    ]
                  },
                  "sub_account_access": {
                    "type": "string",
                    "description": "all or organization_only.",
                    "enum": [
                      "all",
                      "organization_only"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/TeamMemberRef"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "unknown_field",
          "permission_grant_exceeds_your_own",
          "cannot_edit_own_access",
          "forbidden",
          "permission_denied",
          "member_not_found",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/team-members/{id}/resend-invite": {
      "post": {
        "operationId": "teamMembers.resendInvite",
        "tags": [
          "Team Members"
        ],
        "summary": "Resend a team invite",
        "description": "Emails a new invite with a new sign in link; links in earlier invites stop working. Send an Idempotency-Key so a retry does not send a second email. Takes no body. Needs invite_team.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Their id from List team members.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/TeamMemberInviteResult"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_request",
          "unknown_field",
          "no_owner_email",
          "member_not_found",
          "invite_limit",
          "permission_denied",
          "internal_error"
        ],
        "x-ready-idempotent": true
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/validate": {
      "post": {
        "operationId": "validate.create",
        "tags": [
          "Validation"
        ],
        "summary": "Validate numbers",
        "description": "Checks 1 to 1,000 US or Canada numbers for line type (mobile, landline, unknown) and disconnection. Billed at the per-number price for each number that gets an answer, cached answers included; malformed numbers and numbers with no answer are not billed. data is the array of results in input order, with billed_numbers and charged_usd next to it. A 402 may carry required_cents, balance_cents, numbers and billing_url. Needs the edit_contacts permission.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-ready-idempotent": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "phones"
                ],
                "properties": {
                  "phones": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1000,
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 1,000 numbers, E.164 or 10 digits."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "billed_numbers",
                    "charged_usd"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ValidationResult"
                      }
                    },
                    "billed_numbers": {
                      "type": "integer",
                      "description": "How many numbers were billed."
                    },
                    "charged_usd": {
                      "type": "number",
                      "description": "What this call cost, in dollars (exact, may hold fractions of a cent)."
                    },
                    "test": {
                      "type": "boolean",
                      "description": "true for a test key: nothing looked up or charged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "phones_required",
          "too_many_phones",
          "insufficient_credits",
          "client_card_required",
          "validation_in_progress",
          "internal_error",
          "validation_unavailable"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/validate/{phone}": {
      "get": {
        "operationId": "validate.get",
        "tags": [
          "Validation"
        ],
        "summary": "Validate one number",
        "description": "The same check for one number, billed if answered. Send an Idempotency-Key so a retry replays the first answer and bills once. A value that is not a phone number answers 200 with valid false and is not billed. Needs the edit_contacts permission; a view only session gets 403 READ_ONLY_SESSION.",
        "parameters": [
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "description": "E.164 (URL-encode the +) or 10 digits, up to 40 characters.",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "billed_numbers",
                    "charged_usd"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/ValidationResult"
                    },
                    "billed_numbers": {
                      "type": "integer",
                      "description": "How many numbers were billed."
                    },
                    "charged_usd": {
                      "type": "number",
                      "description": "What this call cost, in dollars (exact, may hold fractions of a cent)."
                    },
                    "test": {
                      "type": "boolean",
                      "description": "true for a test key: nothing looked up or charged."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_phone",
          "READ_ONLY_SESSION",
          "insufficient_credits",
          "client_card_required",
          "validation_in_progress",
          "internal_error",
          "validation_unavailable"
        ],
        "x-ready-idempotent": true
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/voice-messages": {
      "get": {
        "operationId": "voiceMessages.list",
        "tags": [
          "Voice messages"
        ],
        "summary": "List voice messages",
        "description": "The voice notes sent and received on the account's iMessage lines, newest first, in the same Message shape, filters and paging as GET /v1/messages. Each row's media_url plays the audio. Voice notes sent before mid-November 2026 are not listed.",
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "inbound or outbound. Any other value is ignored (no filter)."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only messages to this number (E.164 recommended). Must contain digits, else 400 invalid_to. A full number matches the common stored spellings; a partial number that matches too much history answers 422 search_too_broad."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only messages from this number. Same matching rules as to; no digits answers 400 invalid_from."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "A public status word (queued, delivered, failed, undelivered, received and the others listed in the docs). Another word is not refused: it matches only rows stored with exactly that word, and the answer carries warnings."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "Page size, default 50, max 200."
          },
          {
            "name": "before_id",
            "in": "query",
            "schema": {
              "type": [
                "integer",
                "string"
              ]
            },
            "description": "The next_before_id of the previous page (a row id). A row's public id also works. An id that names no message on the account answers 400 invalid_before_id."
          }
        ],
        "x-ready-pagination": {
          "style": "cursor",
          "cursorParam": "before_id",
          "nextCursorField": "next_before_id",
          "hasMoreField": "has_more",
          "itemsField": "data"
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_to",
          "invalid_from",
          "invalid_field",
          "invalid_before_id",
          "search_too_broad"
        ]
      },
      "post": {
        "operationId": "voiceMessages.create",
        "tags": [
          "Voice messages"
        ],
        "summary": "Send a voice message",
        "description": "Sends one voice note from an iMessage line. Upload the audio first with POST /v1/media and send its url as media_url; anything that is not an audio upload of yours answers 400 not_audio. A voice note carries no text. It is billed like an iMessage and answers as Send an iMessage does, including its refusals (many carry fallback sms).",
        "x-ready-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Strict: any other field answers 400 unknown_field.",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "The recipient's phone number in E.164. Send this or conversation_id.",
                    "maxLength": 20
                  },
                  "conversation_id": {
                    "type": "integer",
                    "description": "The conversation to send it in. Send this or to.",
                    "minimum": 1,
                    "maximum": 2147483647
                  },
                  "media_url": {
                    "type": "string",
                    "description": "The url POST /v1/media returned for an audio file (m4a or wav), at most 6 MB.",
                    "maxLength": 2048
                  },
                  "from_line": {
                    "type": "string",
                    "description": "One of your iMessage lines in E.164. Leave it out and Ready picks the line.",
                    "maxLength": 20
                  },
                  "consent_attested": {
                    "type": [
                      "boolean",
                      "string",
                      "integer"
                    ],
                    "description": "Your promise that this recipient agreed to messages from you. true, \"true\" and 1 count as true. Optional today with a warning; from January 20, 2027 an API key send without it is refused with 403 api_consent_attested_required."
                  },
                  "consent_attestation_text": {
                    "type": "string",
                    "description": "Optional: the consent sentence you showed the recipient, recorded with the attestation."
                  }
                },
                "required": [
                  "media_url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageSendResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "missing_recipient",
          "not_audio",
          "invalid_field",
          "unknown_field",
          "invalid_phone",
          "line_not_found",
          "invalid_number",
          "imessage_media_unsupported",
          "imessage_media_too_large",
          "imessage_voice_note_with_text",
          "insufficient_balance",
          "imessage_not_enabled",
          "account_suspended",
          "api_consent_attested_required",
          "global_blocklist",
          "BLOCKED_TCPA",
          "conversation_not_found",
          "opted_out",
          "imessage_awaiting_reply",
          "imessage_attachment_before_reply",
          "imessage_line_draining",
          "QUIET_HOURS_BLOCK",
          "not_on_imessage",
          "imessage_new_contact_limit",
          "rate_limited",
          "imessage_outcome_unknown",
          "imessage_send_failed",
          "imessage_media_unreadable",
          "TCPA_GATE_ERROR",
          "SENDING_KILLED",
          "quiet_hours_confirmation_not_recorded",
          "conversation_lookup_failed",
          "imessage_policy_read_failed",
          "balance_read_failed",
          "account_hold_unknown",
          "blocklist_check_failed",
          "consent_check_failed",
          "imessage_line_unpaid",
          "imessage_sent_not_recorded"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "webhooks.get",
        "tags": [
          "Webhooks"
        ],
        "summary": "Get webhook settings",
        "description": "Your webhook URL, events and on or off state. The signing secret is never returned here. A key without manage_integrations sees only the URL origin.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WebhookSettings"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "internal_error"
        ]
      },
      "put": {
        "operationId": "webhooks.update",
        "tags": [
          "Webhooks"
        ],
        "summary": "Set webhook settings",
        "description": "Sets your webhook URL and events; the save replaces the previous settings. url is required on every call; to pause and keep it, send enabled false. A save without events keeps the saved events (or the four text events if none). Needs a live key of the owner or an admin, with manage_integrations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Your https endpoint, sent on every call. http, private and internal hosts are refused."
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "inbound_reply",
                        "message_delivered",
                        "message_failed",
                        "contact_opted_out",
                        "contact_opted_in",
                        "call_received",
                        "call_completed",
                        "call_recording_ready",
                        "voice_message_received",
                        "registration_approved",
                        "registration_rejected",
                        "registration_in_review",
                        "registration_approval_revoked",
                        "number_active",
                        "number_rejected",
                        "port_request_updated",
                        "vetting_completed",
                        "reply_sorted",
                        "imessage_tapback",
                        "message_read",
                        "imessage_typing",
                        "contact_created"
                      ]
                    },
                    "description": "Events to subscribe to. Not an array counts as left out. Left out: keep the saved events, or the four text events when none are saved. An unknown name is refused."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "JSON boolean. Default true; send false to pause."
                  },
                  "regenerate_secret": {
                    "type": "boolean",
                    "description": "JSON boolean. true rotates the signing secret; the old one stops working at once."
                  },
                  "include_sub_accounts": {
                    "type": "boolean",
                    "description": "JSON boolean. true also sends every sub-account events here, each with a sub_account field. Left out keeps what is saved."
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WebhookSaveResult"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "url_required",
          "invalid_url",
          "invalid_event",
          "invalid_field",
          "permission_denied",
          "OWNER_ONLY",
          "ACCESS_CHECK_UNAVAILABLE",
          "test_key_not_allowed",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/webhooks/test": {
      "post": {
        "operationId": "webhooks.test",
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a test webhook",
        "description": "Sends a signed test event to your saved URL and reports what your endpoint answered. With no body it sends the generic test event; event picks a sample of one event type, or all for one sample of every subscribed event. A test key works too. Any non 2xx from your endpoint, or no answer within 5 seconds, comes back as a 400.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "description": "test (default), all, or any event name.",
                    "enum": [
                      "test",
                      "all",
                      "inbound_reply",
                      "message_delivered",
                      "message_failed",
                      "contact_opted_out",
                      "contact_opted_in",
                      "call_received",
                      "call_completed",
                      "call_recording_ready",
                      "voice_message_received",
                      "registration_approved",
                      "registration_rejected",
                      "registration_in_review",
                      "registration_approval_revoked",
                      "number_active",
                      "number_rejected",
                      "port_request_updated",
                      "vetting_completed",
                      "reply_sorted",
                      "imessage_tapback",
                      "message_read",
                      "imessage_typing",
                      "contact_created"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Your endpoint answered 2xx.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "webhook_not_set",
          "webhook_endpoint_error",
          "webhook_unreachable",
          "webhook_url_invalid",
          "webhook_url_private",
          "webhook_url_unresolved",
          "webhook_url_redirect",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/whatsapp/messages": {
      "post": {
        "operationId": "whatsapp.messages.create",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Send a WhatsApp message",
        "description": "Sends an approved template (any time) or typed text, on a conversation or to a contact (give exactly one of conversation_id and contact_id). Past the 24-hour window typed text goes as its own approved template, else it is held while WhatsApp reviews the words (status pending_approval) and sent once approved. A refusal never falls back to SMS; nothing_sent on an error says whether anything left. Refusals that sent nothing release the Idempotency-Key so a same-key retry runs again. While WhatsApp is not enabled on Ready the route answers 404 with no error code.",
        "x-ready-idempotent": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Strict: any other field answers 400 unknown_field.",
                "properties": {
                  "conversation_id": {
                    "type": "integer",
                    "description": "The conversation to send on.",
                    "minimum": 1,
                    "maximum": 2147483647
                  },
                  "contact_id": {
                    "type": "integer",
                    "description": "The contact to send to; their conversation is opened if they have none.",
                    "minimum": 1,
                    "maximum": 2147483647
                  },
                  "text": {
                    "type": "string",
                    "description": "Typed text, up to 4096 characters. Send text or a template, not both.",
                    "maxLength": 4096
                  },
                  "template_name": {
                    "type": "string",
                    "description": "An approved template of the account's own (from GET /v1/whatsapp/templates). Goes with template_language.",
                    "pattern": "^[a-z0-9_]{1,512}$"
                  },
                  "template_language": {
                    "type": "string",
                    "description": "The template's language code. Goes with template_name.",
                    "pattern": "^[a-z]{2,3}(_[A-Z]{2})?$"
                  },
                  "placeholders": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "description": "One value per template blank, in order, each non-blank."
                  },
                  "consent_attested": {
                    "type": [
                      "boolean",
                      "string",
                      "integer"
                    ],
                    "description": "Your promise that this recipient agreed to messages from you. true, \"true\" and 1 count as true. Optional today with a warning; from January 20, 2027 an API key send without it is refused with 403 api_consent_attested_required."
                  },
                  "consent_attestation_text": {
                    "type": "string",
                    "description": "Optional: the consent sentence you showed the recipient, recorded with the attestation."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsAppSendResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "missing_recipient",
          "invalid_template",
          "invalid_message",
          "empty_message",
          "invalid_field",
          "unknown_field",
          "invalid_number",
          "whatsapp_template_invalid",
          "whatsapp_not_enabled",
          "whatsapp_product_off",
          "api_consent_attested_required",
          "conversation_not_found",
          "contact_not_found",
          "whatsapp_no_sender",
          "whatsapp_window_closed",
          "idempotency_in_progress",
          "whatsapp_template_unknown",
          "whatsapp_template_rejected",
          "whatsapp_send_failed",
          "whatsapp_outcome_unknown",
          "whatsapp_read_failed",
          "conversation_lookup_failed",
          "whatsapp_not_saved"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/whatsapp/messages/prepare": {
      "post": {
        "operationId": "whatsapp.messages.prepare",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Prepare a WhatsApp draft",
        "description": "For a thread past the 24-hour window, submits the draft words for review now so approval often lands before Send. Sends nothing. Inside the window, or when the words cannot be prepared, it answers prepared false; an unexpected failure also answers 200 prepared false. While WhatsApp is not enabled on Ready the route answers 404 with no error code.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Strict: any other field answers 400 unknown_field.",
                "properties": {
                  "conversation_id": {
                    "type": "integer",
                    "description": "The conversation the draft is for.",
                    "minimum": 1,
                    "maximum": 2147483647
                  },
                  "text": {
                    "type": "string",
                    "description": "The draft words, up to 4096 characters.",
                    "maxLength": 4096
                  }
                },
                "required": [
                  "conversation_id",
                  "text"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WhatsAppPrepareResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "unknown_field",
          "conversation_not_found",
          "whatsapp_not_enabled",
          "whatsapp_no_sender",
          "whatsapp_read_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/whatsapp/messages/{id}/withdraw": {
      "post": {
        "operationId": "whatsapp.messages.withdraw",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Withdraw a held WhatsApp message",
        "description": "Cancels a message that is still waiting for template approval or quiet hours, so it never goes. Works once: a message no longer waiting answers 409 whatsapp_not_waiting. While WhatsApp is not enabled on Ready the route answers 404 with no error code.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,11}$"
            },
            "description": "The message_id the send returned."
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "message_id"
                      ],
                      "properties": {
                        "message_id": {
                          "type": "integer",
                          "description": "The withdrawn message."
                        },
                        "body": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The words that were waiting, so the app can put them back in the composer."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "conversation_not_found",
          "whatsapp_not_waiting",
          "whatsapp_withdraw_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/whatsapp/numbers": {
      "get": {
        "operationId": "whatsapp.numbers.list",
        "tags": [
          "WhatsApp"
        ],
        "summary": "List WhatsApp numbers",
        "description": "The account's WhatsApp number, the sender Ready staff attached, or an empty list. display_name, photo and pending_name are null when the profile could not be read. While WhatsApp is not enabled on Ready the route answers 404 with no error code.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "numbers"
                      ],
                      "properties": {
                        "numbers": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/WhatsAppNumber"
                          },
                          "description": "Zero or one number."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "whatsapp_read_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/whatsapp/numbers/profile": {
      "put": {
        "operationId": "whatsapp.numbers.profile.update",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Update the WhatsApp profile",
        "description": "Changes the account's WhatsApp number's photo, about, description, website or category, or asks for a new display name. A new name is reviewed by WhatsApp: the old one stays live and the answer says name_review pending. Send at least one field. Needs manage_phones. While WhatsApp is not enabled on Ready the route answers 404 with no error code.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Strict: any other field answers 400 unknown_field.",
                "properties": {
                  "photo": {
                    "type": "string",
                    "description": "A JPEG or PNG data URL, square, at least 192 pixels, at most 5 MB."
                  },
                  "about": {
                    "type": "string",
                    "description": "Short about text, up to 139 characters. Blank is ignored.",
                    "maxLength": 139
                  },
                  "description": {
                    "type": "string",
                    "description": "Business description, up to 512 characters. Blank is ignored.",
                    "maxLength": 512
                  },
                  "website": {
                    "type": "string",
                    "description": "An http or https address, up to 256 characters. An empty string clears it.",
                    "maxLength": 256
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "Automotive",
                      "Beauty, spa and salon",
                      "Clothing and apparel",
                      "Education",
                      "Entertainment",
                      "Event planning and service",
                      "Finance and banking",
                      "Food and grocery",
                      "Hotel and lodging",
                      "Medical and health",
                      "Nonprofit",
                      "Professional services",
                      "Public service",
                      "Restaurant",
                      "Shopping and retail",
                      "Travel and transportation",
                      "Other"
                    ],
                    "description": "The business category, in these words."
                  },
                  "display_name": {
                    "type": "string",
                    "description": "A new display name to submit for review, up to 75 characters.",
                    "maxLength": 75
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "name_review": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "pending when a new display name was submitted for review, else null."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "whatsapp_profile_invalid",
          "invalid_field",
          "unknown_field",
          "whatsapp_no_sender",
          "whatsapp_profile_failed",
          "whatsapp_read_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/whatsapp/templates": {
      "get": {
        "operationId": "whatsapp.templates.list",
        "tags": [
          "WhatsApp"
        ],
        "summary": "List WhatsApp templates",
        "description": "The templates this account submitted, with their review status. Only the account's own templates are listed, never every template its sender's business account holds. Empty when the account has no WhatsApp number. While WhatsApp is not enabled on Ready the route answers 404 with no error code.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "templates"
                      ],
                      "properties": {
                        "templates": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/WhatsAppTemplate"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "whatsapp_read_failed",
          "whatsapp_templates_unavailable"
        ]
      },
      "post": {
        "operationId": "whatsapp.templates.create",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Submit a WhatsApp template",
        "description": "Submits a template to WhatsApp for review and adds it to the account's list; nothing reaches a contact. The body's blanks must run {{1}} to {{n}} with one sample each in examples. A name already used in that language answers 422 whatsapp_template_refused. Needs manage_phones. While WhatsApp is not enabled on Ready the route answers 404 with no error code.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Strict: any other field answers 400 unknown_field.",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Lowercase letters, digits and underscores, 1 to 512 characters.",
                    "pattern": "^[a-z0-9_]{1,512}$",
                    "example": "booking_reminder"
                  },
                  "language": {
                    "type": "string",
                    "description": "Language code like en or en_GB.",
                    "pattern": "^[a-z]{2,3}(_[A-Z]{2})?$",
                    "example": "en_GB"
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "marketing",
                      "utility"
                    ],
                    "description": "The template category."
                  },
                  "body": {
                    "type": "string",
                    "description": "The template text, up to 1024 characters, with blanks as {{1}}, {{2}} and so on (at most 20).",
                    "maxLength": 1024
                  },
                  "examples": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string"
                    },
                    "description": "One sample value per blank, in order. Required when the body has blanks."
                  },
                  "buttons": {
                    "type": "array",
                    "maxItems": 10,
                    "items": {
                      "$ref": "#/components/schemas/WhatsAppTemplateButton"
                    },
                    "description": "Up to 10 buttons, at most 2 of them links."
                  }
                },
                "required": [
                  "name",
                  "language",
                  "category",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Submitted; status is pending.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WhatsAppTemplate"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "invalid_field",
          "unknown_field",
          "whatsapp_template_invalid",
          "whatsapp_no_sender",
          "whatsapp_template_refused",
          "whatsapp_template_unconfirmed",
          "whatsapp_template_not_listed",
          "whatsapp_read_failed"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/white-label": {
      "get": {
        "operationId": "whiteLabel.get",
        "tags": [
          "White Label"
        ],
        "summary": "Get your brand",
        "description": "Your white label brand as the White label card shows it. Only the account that runs white label, or an admin seat of it, can read it; a key acting as a sub-account gets not_agency_owner. A 404 no_brand body also carries monthly_fee_cents (the monthly price of joining, in cents).",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WhiteLabelBrand"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "not_agency_owner",
          "no_brand"
        ]
      },
      "put": {
        "operationId": "whiteLabel.update",
        "tags": [
          "White Label"
        ],
        "summary": "Set your brand",
        "description": "Changes your brand name, logo, color or support email; send only the fields to change. The on and off switch stays with Ready. Answers 402 fee_unpaid until the first month is paid on the Partner page. Needs invite_team.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Brand name your sub-accounts see.",
                    "maxLength": 2048
                  },
                  "logo_url": {
                    "type": "string",
                    "description": "URL of your logo (upload with POST /v1/media/brand-logo).",
                    "maxLength": 2048
                  },
                  "primary_color": {
                    "type": "string",
                    "description": "Main color, for example #1a73e8. Too light for white text is refused.",
                    "maxLength": 2048
                  },
                  "support_email": {
                    "type": "string",
                    "description": "Help email for your sub-accounts.",
                    "maxLength": 2048
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WhiteLabelBrand"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "not_agency_owner",
          "needs_team_access",
          "nothing_to_change",
          "unknown_field",
          "invalid_name",
          "invalid_logo_url",
          "invalid_primary_color",
          "invalid_support_email",
          "fee_unpaid",
          "no_brand",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/white-label/domain": {
      "post": {
        "operationId": "whiteLabel.domain.update",
        "tags": [
          "White Label"
        ],
        "summary": "Set your custom domain",
        "description": "Saves the domain your sub-accounts sign in on and returns the DNS records to add. A live domain you already have stops working as soon as you save a new one, so add the new records first. Saving the same domain again is safe. Needs invite_team and the first month paid.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "The domain, for example app.acme.example.com.",
                    "maxLength": 253
                  }
                },
                "required": [
                  "domain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WhiteLabelDomain"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "not_agency_owner",
          "needs_team_access",
          "invalid_field",
          "unknown_field",
          "fee_unpaid",
          "no_brand",
          "domain_taken",
          "domain_setup_failed",
          "domains_unavailable",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/white-label/domain/check": {
      "post": {
        "operationId": "whiteLabel.domain.check",
        "tags": [
          "White Label"
        ],
        "summary": "Check your domain again",
        "description": "Checks now whether your DNS records are in place; waiting says what is still missing. On a failed domain this reopens the automatic check for another 72 hours. Takes no body. Needs invite_team.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WhiteLabelDomain"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "not_agency_owner",
          "needs_team_access",
          "fee_unpaid",
          "no_brand",
          "domain_setup_failed",
          "domains_unavailable",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    },
    "/v1/white-label/join-link": {
      "get": {
        "operationId": "whiteLabel.joinLink.get",
        "tags": [
          "White Label"
        ],
        "summary": "Get your join link",
        "description": "The private sign up link for your sub-accounts, the daily sign up limit, and the sign ups waiting for your answer. url is null when the link is off.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WhiteLabelJoinLink"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "not_agency_owner",
          "internal_error"
        ]
      },
      "post": {
        "operationId": "whiteLabel.joinLink.create",
        "tags": [
          "White Label"
        ],
        "summary": "Make a new join link",
        "description": "Makes a new join link; the old link stops working. Takes no body. Needs invite_team.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WhiteLabelJoinLink"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "not_agency_owner",
          "needs_team_access",
          "internal_error"
        ]
      },
      "delete": {
        "operationId": "whiteLabel.joinLink.delete",
        "tags": [
          "White Label"
        ],
        "summary": "Turn off the join link",
        "description": "Turns the join link off; accounts that already signed up stay. Answers data.url null. Needs invite_team.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always true on success."
                    },
                    "data": {
                      "$ref": "#/components/schemas/WhiteLabelJoinLink"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "x-ready-error-codes": [
          "not_agency_owner",
          "needs_team_access",
          "internal_error"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/SubAccountId"
        }
      ]
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Your API key, rsms_..."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "The same API key as a bearer token: Authorization: Bearer rsms_..."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Any opaque string, unique per intended write. A retry with the same key replays the first answer (Idempotent-Replayed: true) instead of sending or charging twice; 409 idempotency_in_progress while the first is still running. Keys are kept 7 days.",
        "schema": {
          "type": "string",
          "maxLength": 255
        }
      },
      "SubAccountId": {
        "name": "X-Sub-Account-Id",
        "in": "header",
        "required": false,
        "description": "Run this request as one of your sub-accounts (agencies). Refused with 400 invalid_sub_account_id, 403 sub_account_forbidden, 403 sub_account_suspended or 404 sub_account_not_found.",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]+$"
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": false,
            "description": "Always false on an error."
          },
          "error": {
            "type": "string",
            "description": "A sentence for people. It can change: do not parse it."
          },
          "error_code": {
            "type": "string",
            "description": "The stable code to branch on. Read error_code ?? code."
          },
          "code": {
            "type": "string",
            "description": "The stable code on errors that do not send error_code."
          },
          "request_id": {
            "type": "string",
            "description": "On every 5xx: the same id as the X-Request-Id header."
          },
          "setup_url": {
            "type": "string",
            "description": "On a refusal you can fix: the page that fixes it."
          },
          "retry_after_ms": {
            "type": "integer",
            "description": "On a pacing 429: how long to wait."
          }
        },
        "additionalProperties": true
      },
      "Message": {
        "type": "object",
        "description": "One message as GET /v1/messages lists it.",
        "required": [
          "id",
          "message_id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The message's public id. Opaque; often longer than 15 digits, so keep it a string."
          },
          "message_id": {
            "type": "string",
            "description": "The same value as id."
          },
          "direction": {
            "type": "string",
            "description": "inbound or outbound."
          },
          "from": {
            "type": "string",
            "description": "Sender (E.164; an email address on a cold email row)."
          },
          "to": {
            "type": "string",
            "description": "Recipient (E.164)."
          },
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "The text the sender asked to send."
          },
          "sent_body": {
            "type": [
              "string",
              "null"
            ],
            "description": "The exact text sent, which can include an opt-out line or business name Ready added."
          },
          "status": {
            "type": "string",
            "description": "Public status: queued, delivered, failed, undelivered, unknown or received (inbound); see the docs for the full set."
          },
          "error_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "A stable failure cause to branch and count on (for example recipient_unreachable, carrier_filtered_content, blocked_before_send); null unless status is failed or undelivered. See the docs for the full list."
          },
          "error_detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "A readable sentence for a person; wording can change. null when error_reason is."
          },
          "blocked": {
            "type": "boolean",
            "description": "true when Ready held the text before sending it (opt-out, bad number, litigator, content filter). No carrier saw it."
          },
          "blocked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which check held a blocked text: content_review_held, content_blocked, the send refusal code (for example opt_out_locked, quiet_hours), or other. null when not blocked. New values may be added."
          },
          "segments": {
            "type": "integer",
            "description": "Billed segments, counted on sent_body."
          },
          "cost_usd": {
            "type": [
              "number",
              "null"
            ],
            "description": "What the first send cost, in US dollars. null for a sub-account its agency pays for."
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The attached media URL, or null."
          },
          "created_at": {
            "type": "string",
            "description": "When it was created (ISO 8601).",
            "format": "date-time"
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was delivered (ISO 8601), or null.",
            "format": "date-time"
          },
          "reply_category": {
            "type": [
              "string",
              "null"
            ],
            "description": "The AI reply-sorting label of an inbound reply, such as interested; null otherwise."
          }
        }
      },
      "MessageDetail": {
        "type": "object",
        "description": "One message as GET /v1/messages/{id} returns it.",
        "required": [
          "id",
          "message_id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The message's public id, as GET /v1/messages lists it."
          },
          "message_id": {
            "type": "string",
            "description": "The id the caller asked with."
          },
          "status": {
            "type": "string",
            "description": "Public status, as on Message."
          },
          "error_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "A stable failure cause to branch and count on (for example recipient_unreachable, carrier_filtered_content, blocked_before_send); null unless status is failed or undelivered. See the docs for the full list."
          },
          "error_detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "A readable sentence for a person; wording can change. null when error_reason is."
          },
          "blocked": {
            "type": "boolean",
            "description": "true when Ready held the text before sending it (opt-out, bad number, litigator, content filter). No carrier saw it."
          },
          "blocked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which check held a blocked text: content_review_held, content_blocked, the send refusal code (for example opt_out_locked, quiet_hours), or other. null when not blocked. New values may be added."
          },
          "from": {
            "type": "string",
            "description": "Sender (E.164)."
          },
          "to": {
            "type": "string",
            "description": "Recipient (E.164)."
          },
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "The text the sender asked to send."
          },
          "sent_body": {
            "type": [
              "string",
              "null"
            ],
            "description": "The exact text sent."
          },
          "media_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The attached media URL, or null."
          },
          "segments": {
            "type": "integer",
            "description": "Billed segments."
          },
          "created_at": {
            "type": "string",
            "description": "When it was created (ISO 8601).",
            "format": "date-time"
          },
          "sent_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When Ready handed it to the carrier (ISO 8601), or null.",
            "format": "date-time"
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was delivered (ISO 8601), or null.",
            "format": "date-time"
          },
          "reply_category": {
            "type": [
              "string",
              "null"
            ],
            "description": "The AI reply-sorting label of an inbound reply, or null."
          }
        }
      },
      "MessageListResponse": {
        "type": "object",
        "required": [
          "success",
          "data",
          "has_more",
          "next_before_id"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "Keep paging while true. True on an exactly full page, so the last page can be empty."
          },
          "next_before_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pass as before_id for the next page (a row id); null on an empty page."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Only present when part of the query was ignored or may not do what was meant (offset, page, an unknown status word)."
          }
        }
      },
      "MessageSendResult": {
        "type": "object",
        "description": "The data of an accepted send. On the iMessage path (from is one of your iMessage lines) only message_id (an integer), public_message_id, conversation_id, channel, status, to and from are sent.",
        "properties": {
          "message_id": {
            "type": [
              "string",
              "integer",
              "null"
            ],
            "description": "Store it. A string public id for a text; Ready's integer row id when sent as iMessage (use public_message_id there to match GET /v1/messages and webhooks). null on a held text."
          },
          "public_message_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "iMessage path only: the id GET /v1/messages and the delivery webhooks use."
          },
          "channel": {
            "type": "string",
            "description": "imessage on the iMessage path; absent on a text."
          },
          "conversation_id": {
            "type": "integer",
            "description": "The conversation the message was saved in."
          },
          "status": {
            "type": "string",
            "description": "queued on an accepted send; held on a held one."
          },
          "from": {
            "type": "string",
            "description": "The number it went from (the one Ready picked when from was left out)."
          },
          "to": {
            "type": "string",
            "description": "The number it went to."
          },
          "segments": {
            "type": "integer",
            "description": "Billed segments, counted on sent_body."
          },
          "sent_body": {
            "type": "string",
            "description": "The exact text sent."
          },
          "compliance_text_added": {
            "type": [
              "string",
              "null"
            ],
            "description": "Just the text Ready added (opt-out line, business name), or null."
          },
          "sent_at": {
            "type": "string",
            "description": "When Ready handed it to the carrier (ISO 8601).",
            "format": "date-time"
          },
          "sent_at_unix": {
            "type": "integer",
            "description": "sent_at in Unix seconds."
          },
          "carrier_fee": {
            "type": "number",
            "description": "Carrier fee in US dollars."
          },
          "balance_usd": {
            "type": [
              "number",
              "null"
            ],
            "description": "Balance after this send, in US dollars. null for an account its agency pays for."
          },
          "carrier_balance": {
            "type": [
              "number",
              "null"
            ],
            "description": "Legacy copy of balance_usd, in US dollars."
          },
          "credits_remaining": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Legacy: approximate 1-segment texts the balance covers."
          }
        }
      },
      "MessageSendResponse": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true when accepted. false with error_code empty_merge_field when a blank merge field needs confirmation (nothing sent)."
          },
          "data": {
            "$ref": "#/components/schemas/MessageSendResult"
          },
          "recorded": {
            "type": "boolean",
            "description": "false (rare): sent and charged but not saved. Do not resend."
          },
          "warning": {
            "type": "string",
            "description": "A sentence explaining recorded false."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Plain sentences, present only when there is something to warn about (for example a missing consent_attested on an API key send). Wording can change: log them, do not match on them."
          },
          "error_code": {
            "type": "string",
            "description": "empty_merge_field when success is false."
          },
          "error": {
            "type": "string",
            "description": "Plain sentence when success is false."
          },
          "message": {
            "type": "string",
            "description": "Plain sentence describing the blank merge field."
          },
          "needs_confirmation": {
            "type": "boolean",
            "description": "true on empty_merge_field: resend with confirm_empty_merge true to send with the blank."
          },
          "empty_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The blank merge tokens. Read this to decide in code."
          },
          "preflight": {
            "type": "object",
            "description": "The check behind empty_merge_field, for showing a person what is blank (total, blank_recipients, empty, did_you_mean, sample_render ...)."
          }
        }
      },
      "MessageHeldResponse": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true for a held text; false for send_outcome_unknown."
          },
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "description": "held."
              },
              "message_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "null: no message exists until it sends."
              },
              "queue_id": {
                "type": "integer",
                "description": "The held text; cancel it with DELETE /sms/held/{queue_id}."
              },
              "send_at": {
                "type": "string",
                "description": "When it will send (ISO 8601).",
                "format": "date-time"
              }
            }
          },
          "held": {
            "type": "boolean",
            "description": "true on a held text."
          },
          "status": {
            "type": "string",
            "description": "Legacy, reads queued; read data.status."
          },
          "code": {
            "type": "string",
            "description": "QUIET_HOURS_HELD, NUMBER_ACTIVATING_HELD or CARRIER_BUSY_HELD."
          },
          "recorded": {
            "type": "boolean",
            "description": "false: nothing saved yet."
          },
          "warning": {
            "type": "string",
            "description": "Why it was held and when it sends."
          },
          "message": {
            "type": "string",
            "description": "Same as warning."
          },
          "reason": {
            "type": "string",
            "description": "Hold reason, such as after_9pm."
          },
          "queued_for": {
            "type": "string",
            "description": "Same time as data.send_at.",
            "format": "date-time"
          },
          "recipient_tz": {
            "type": "string",
            "description": "The time zone used for the recipient."
          },
          "error_code": {
            "type": "string",
            "description": "send_outcome_unknown when success is false."
          },
          "error": {
            "type": "string",
            "description": "Plain sentence when success is false."
          },
          "outcome": {
            "type": "string",
            "description": "unknown when success is false: it may have been delivered and charged."
          }
        }
      },
      "MessageBulkRecipientResult": {
        "type": "object",
        "required": [
          "to",
          "status",
          "sent"
        ],
        "properties": {
          "to": {
            "type": "string",
            "description": "The recipient."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status a single send would have returned."
          },
          "sent": {
            "type": "boolean",
            "description": "true when accepted."
          },
          "held": {
            "type": "boolean",
            "description": "true when held for quiet hours (counts in held, not failed)."
          },
          "message_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "On a sent recipient: its message id (a test-msg- id on a test key)."
          },
          "segments": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Billed segments on a sent recipient."
          },
          "sent_body": {
            "type": [
              "string",
              "null"
            ],
            "description": "The exact text sent."
          },
          "error": {
            "type": "string",
            "description": "Why it was not sent. Read it before retrying."
          },
          "error_code": {
            "type": "string",
            "description": "What a single send returns for the refusal, else send_failed, send_error (safe to retry), not_attempted (nothing sent, send again) or send_outcome_unknown."
          },
          "code": {
            "type": "string",
            "description": "Same value as error_code."
          },
          "outcome_unknown": {
            "type": "boolean",
            "description": "Present and true only when the text may have gone out: check GET /v1/messages before resending."
          },
          "retryable": {
            "type": "boolean",
            "description": "true on a registration or number-setup refusal that clears on its own."
          },
          "help": {
            "type": "string",
            "description": "Next step on a registration or number-setup refusal."
          },
          "setup_url": {
            "type": "string",
            "description": "Link to fix a registration refusal."
          },
          "queue_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Held recipient: the held text."
          },
          "queued_for": {
            "type": [
              "string",
              "null"
            ],
            "description": "Held recipient: when it sends."
          },
          "send_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Held recipient: when it sends."
          },
          "recipient_tz": {
            "type": [
              "string",
              "null"
            ],
            "description": "Held recipient: the time zone used."
          },
          "warning": {
            "type": [
              "string",
              "null"
            ],
            "description": "Held recipient: why it was held."
          }
        }
      },
      "MessageBulkResult": {
        "type": "object",
        "required": [
          "total",
          "sent",
          "held",
          "failed",
          "results"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Recipients processed."
          },
          "sent": {
            "type": "integer",
            "description": "How many were accepted."
          },
          "held": {
            "type": "integer",
            "description": "How many are held for quiet hours and will send on their own."
          },
          "failed": {
            "type": "integer",
            "description": "Every recipient neither sent nor held, including ones whose outcome is unknown."
          },
          "group": {
            "type": "boolean",
            "description": "true on a group send; absent otherwise."
          },
          "group_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Group send only: the group chat it was filed in, or null when nobody was sent to or the filing failed."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageBulkRecipientResult"
            },
            "description": "One per recipient."
          }
        }
      },
      "MessageDeleteResult": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The deleted message's row id (the number next_before_id pages by)."
          }
        }
      },
      "MessageBulkDeleteResult": {
        "type": "object",
        "required": [
          "deleted",
          "requested"
        ],
        "properties": {
          "deleted": {
            "type": "integer",
            "description": "How many messages were deleted."
          },
          "requested": {
            "type": "integer",
            "description": "How many of the ids matched a message in the account (0 when none matched, as on a retry)."
          }
        }
      },
      "IMessageSendResponse": {
        "type": "object",
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true."
          },
          "data": {
            "type": "object",
            "required": [
              "channel"
            ],
            "properties": {
              "message_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Ready's own integer id for the message (webhooks carry it as ready_message_id). null when the send was not recorded."
              },
              "channel": {
                "type": "string",
                "description": "Always imessage."
              },
              "conversation_id": {
                "type": "integer",
                "description": "The conversation it went into."
              },
              "public_message_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The id GET /v1/messages lists and delivery webhooks carry as message_id; null when the send could not be recorded."
              }
            }
          },
          "recorded": {
            "type": "boolean",
            "description": "false with code imessage_sent_not_recorded: sent but not saved. Do not resend."
          },
          "code": {
            "type": "string",
            "description": "imessage_sent_not_recorded when recorded is false."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Plain sentences, present only when there is something to warn about (for example a missing consent_attested on an API key send). Wording can change: log them, do not match on them."
          }
        }
      },
      "MediaUploadResponse": {
        "type": "object",
        "description": "A bare body: no data key.",
        "required": [
          "success",
          "url",
          "content_type",
          "size"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true."
          },
          "url": {
            "type": "string",
            "description": "The public link to the file. Anyone with it can open it. Pass it as media_url."
          },
          "content_type": {
            "type": "string",
            "description": "The file's type, like image/jpeg."
          },
          "size": {
            "type": "integer",
            "description": "Bytes stored."
          }
        }
      },
      "IMessageLineList": {
        "type": "object",
        "required": [
          "lines",
          "monthly_cents",
          "consent_text"
        ],
        "properties": {
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "line"
              ],
              "properties": {
                "line": {
                  "type": "string",
                  "description": "The line's phone number (E.164)."
                }
              }
            },
            "description": "One entry per line; empty when there are none."
          },
          "monthly_cents": {
            "type": "integer",
            "description": "What one line costs the account a month, in cents."
          },
          "consent_text": {
            "type": "string",
            "description": "The sentence a purchase agrees to with consent_attested true. It can change: read it before each purchase."
          }
        }
      },
      "IMessageLineCheckout": {
        "type": "object",
        "description": "One of three shapes: a hold on the saved card (authorized, amount, payment_intent_id, card_brand, card_last4), a client_secret only the app can confirm (client_secret, amount, has_card), or free true.",
        "properties": {
          "line": {
            "type": "string",
            "description": "blue."
          },
          "charged": {
            "type": "boolean",
            "description": "false: nothing is taken until the buy."
          },
          "authorized": {
            "type": "boolean",
            "description": "true when the first month is held on the card."
          },
          "amount": {
            "type": "integer",
            "description": "The amount held, in cents."
          },
          "payment_intent_id": {
            "type": "string",
            "description": "Send it to POST /v1/imessage-lines."
          },
          "card_brand": {
            "type": "string",
            "description": "The card's brand."
          },
          "card_last4": {
            "type": "string",
            "description": "The card's last four digits."
          },
          "client_secret": {
            "type": "string",
            "description": "Only the app can confirm this payment; nothing is held."
          },
          "has_card": {
            "type": "boolean",
            "description": "Whether a card is on file, with client_secret."
          },
          "free": {
            "type": "boolean",
            "description": "true when there is nothing to pay: buy without payment_intent_id."
          }
        }
      },
      "IMessageLinePurchase": {
        "type": "object",
        "properties": {
          "line": {
            "type": "string",
            "description": "blue."
          },
          "line_number": {
            "type": "string",
            "description": "The new line's phone number (E.164)."
          },
          "first_month": {
            "type": "string",
            "description": "charged (the held amount was taken), exempt or free."
          },
          "imessage_on": {
            "type": "boolean",
            "description": "Whether iMessage is on. false means Ready staff were told and will switch it on."
          },
          "already_owned": {
            "type": "boolean",
            "description": "true when this purchase had already finished; nothing more was taken."
          },
          "blue_lines": {
            "type": "integer",
            "description": "Only with already_owned: how many iMessage lines the account has now."
          },
          "note": {
            "type": "string",
            "description": "A plain sentence about the result."
          }
        }
      },
      "IMessageLineCancelResult": {
        "type": "object",
        "required": [
          "line",
          "lines_left"
        ],
        "properties": {
          "line": {
            "type": "string",
            "description": "The cancelled line."
          },
          "lines_left": {
            "type": "integer",
            "description": "Lines still on the account."
          }
        }
      },
      "WhatsAppNumber": {
        "type": "object",
        "required": [
          "e164",
          "status"
        ],
        "properties": {
          "e164": {
            "type": "string",
            "description": "The WhatsApp number (E.164)."
          },
          "status": {
            "type": "string",
            "description": "connected."
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name contacts see, or null when it could not be read."
          },
          "photo": {
            "type": [
              "string",
              "null"
            ],
            "description": "The profile photo URL, or null."
          },
          "pending_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "A display name waiting for review, or null."
          }
        }
      },
      "WhatsAppTemplate": {
        "type": "object",
        "required": [
          "name",
          "language"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The template name."
          },
          "language": {
            "type": "string",
            "description": "Its language code."
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "description": "marketing or utility (lowercase), or null."
          },
          "status": {
            "type": "string",
            "description": "Ready's status word: approved, pending, rejected, paused, disabled, or unknown for any other provider value."
          },
          "rejected_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it was rejected, or null."
          },
          "body": {
            "type": "string",
            "description": "The template text."
          },
          "variables": {
            "type": "integer",
            "description": "The number of blanks ({{1}} to {{n}}) in the body."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was created (ISO 8601), or null.",
            "format": "date-time"
          }
        }
      },
      "WhatsAppTemplateButton": {
        "type": "object",
        "required": [
          "type",
          "title"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "quick_reply",
              "url"
            ],
            "description": "A quick reply or a link button."
          },
          "title": {
            "type": "string",
            "description": "The button text, up to 25 characters.",
            "maxLength": 25
          },
          "url": {
            "type": "string",
            "description": "Link buttons only: an https address, up to 2000 characters.",
            "maxLength": 2000
          }
        }
      },
      "WhatsAppSendResult": {
        "type": "object",
        "required": [
          "channel",
          "conversation_id",
          "status"
        ],
        "properties": {
          "message_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Ready's id for the message."
          },
          "provider_message_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The WhatsApp message id; null while the message is held."
          },
          "kind": {
            "type": "string",
            "description": "text or template."
          },
          "status": {
            "type": "string",
            "description": "sent, pending_approval (held while the words are reviewed) or held_quiet_hours."
          },
          "conversation_id": {
            "type": "integer",
            "description": "The conversation it went on."
          },
          "channel": {
            "type": "string",
            "description": "Always whatsapp."
          }
        }
      },
      "WhatsAppSendResponse": {
        "type": "object",
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true."
          },
          "data": {
            "$ref": "#/components/schemas/WhatsAppSendResult"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Plain sentences, present only when there is something to warn about (for example a missing consent_attested on an API key send). Wording can change: log them, do not match on them."
          }
        }
      },
      "WhatsAppPrepareResult": {
        "type": "object",
        "required": [
          "prepared"
        ],
        "properties": {
          "prepared": {
            "type": "boolean",
            "description": "true when the words were submitted for review (or were already known)."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "The template's review status (for example pending), or null."
          }
        }
      },
      "NumberSpam": {
        "type": "object",
        "description": "Spam signals for the number.",
        "properties": {
          "sms_flagged": {
            "type": "boolean",
            "description": "Flagged by web spam reports."
          },
          "sms_reports": {
            "type": "integer",
            "description": "How many web spam reports."
          },
          "sms_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the reports were last checked, ISO 8601."
          },
          "caller_flagged": {
            "type": "boolean",
            "description": "true when carriers label the number Spam Likely."
          },
          "caller_flagged_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the latest check found the label, or null while the number is not flagged now."
          }
        }
      },
      "Number": {
        "type": "object",
        "required": [
          "id",
          "type",
          "phone_number",
          "status"
        ],
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The number id (phone_number_id from the purchase). null for an iMessage line."
          },
          "type": {
            "type": "string",
            "description": "sms for a phone number, imessage for one of the account's iMessage lines. Lines appear only in the unpaged list and carry only id, type, phone_number, status (and account_id)."
          },
          "phone_number": {
            "type": "string",
            "description": "The number in E.164, like +12125550100. While it is being set up it is a placeholder like \"Pending (212)\", not a phone number."
          },
          "status": {
            "type": "string",
            "description": "Only active can send; treat any other value as not sendable. Known values: active; pending_provisioning and pending (being set up); provider_rejected and payment_declined (failed, stop polling); billing_suspended and suspended (cannot send); released, inactive, retired, cancelled, canceled (no longer in use); deleted (released). New values may be added."
          },
          "created_at": {
            "type": "string",
            "description": "When the number was added, ISO 8601."
          },
          "webhook_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The number's own webhook URL, or null when its events go to the account webhook."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The number's label."
          },
          "forward_to_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where its calls ring (E.164), or null."
          },
          "campaign_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The id of the registration campaign it sends under (a long id, not the short registry id), or null."
          },
          "shared_registration": {
            "type": "boolean",
            "description": "true when campaign_id is Ready's shared registration campaign rather than the account's own."
          },
          "daily_cap": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The most texts it sends in a day, or null for no cap."
          },
          "use_for_texting": {
            "type": "boolean",
            "description": "Whether Ready picks it as a sender for texts."
          },
          "use_for_calling": {
            "type": "boolean",
            "description": "Whether it is offered as a caller ID."
          },
          "resting": {
            "type": "boolean",
            "description": "true while it is resting: Ready does not pick it as a sender."
          },
          "rested_until": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the rest ends, ISO 8601, or null when not resting. A rest until resumed shows a date years away."
          },
          "spam": {
            "$ref": "#/components/schemas/NumberSpam"
          },
          "account_id": {
            "type": "integer",
            "description": "The account that holds the number. Only with include_sub_accounts=true."
          }
        }
      },
      "NumberCheckout": {
        "type": "object",
        "description": "The checkout answer. Which fields appear depends on the path: a charged or held card, a no-charge account, a test key, no saved card, or a bank check.",
        "properties": {
          "payment_intent_id": {
            "type": "string",
            "description": "Pass it to POST /v1/numbers. Treat it as opaque: test keys and accounts that are not charged get ids that do not start with pi_. Absent on a bank check and when there is no card."
          },
          "charged": {
            "type": "boolean",
            "description": "true when the first month was charged."
          },
          "authorized": {
            "type": "boolean",
            "description": "true when the first month is held on the card, captured when the number is provisioned."
          },
          "card_brand": {
            "type": "string",
            "description": "The card used."
          },
          "card_last4": {
            "type": "string",
            "description": "The last 4 digits of the card used."
          },
          "exempt": {
            "type": "boolean",
            "description": "true when nothing is owed (charged is false)."
          },
          "included": {
            "type": "boolean",
            "description": "true when this is the account's included number."
          },
          "training": {
            "type": "boolean",
            "description": "true for a training or no-send test account."
          },
          "test": {
            "type": "boolean",
            "description": "true on a test-mode key: nothing was charged."
          },
          "note": {
            "type": "string",
            "description": "A sentence about a test-mode answer."
          },
          "client_secret": {
            "type": "string",
            "description": "When there is no card on file, or the bank wants the card confirmed. The API cannot finish that payment: add a card in Settings, or buy in the app."
          },
          "has_card": {
            "type": "boolean",
            "description": "false when there is no saved card."
          },
          "bank_check": {
            "type": "boolean",
            "description": "true when the bank wants the saved card confirmed (3-D Secure). Nothing was charged and there is no payment_intent_id; buy the number in the app."
          },
          "payment_method_id": {
            "type": "string",
            "description": "The saved card to confirm, on a bank check."
          }
        }
      },
      "NumberPurchaseResult": {
        "type": "object",
        "description": "POST /v1/numbers answers at the top level, not inside data (except a test-mode or overseas test answer, which nests data).",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          },
          "instant": {
            "type": "boolean",
            "description": "true: the number is ready now and phone_number is real. false: ordered from the carrier, no phone_number yet."
          },
          "id": {
            "type": "integer",
            "description": "The number id, same as phone_number_id."
          },
          "phone_number_id": {
            "type": "integer",
            "description": "The number id; store it and poll GET /v1/numbers/{id}."
          },
          "phone_number": {
            "type": "string",
            "description": "The number, E.164, on an instant buy."
          },
          "area_code": {
            "type": "string",
            "description": "The area code ordered, on a carrier order."
          },
          "country": {
            "type": "string",
            "description": "The country, on an overseas buy."
          },
          "pending_provisioning": {
            "type": "boolean",
            "description": "true: being set up, usually within a few minutes; poll until active."
          },
          "pending_campaign_approval": {
            "type": "boolean",
            "description": "true: the account's own registration is not approved yet."
          },
          "can_send_now": {
            "type": "boolean",
            "description": "On an instant US buy: whether the number can text now."
          },
          "replaced_phone_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The number this purchase replaced, if any (instant buy)."
          },
          "note": {
            "type": "string",
            "description": "A sentence on what happens next."
          },
          "overflow_registration_started": {
            "type": "boolean",
            "description": "Present and true only when the registration was full and Ready started a second one at no cost."
          },
          "test": {
            "type": "boolean",
            "description": "true on a test-mode key: nothing was provisioned."
          },
          "data": {
            "type": "object",
            "description": "Only on a test-mode key: { phone_number, provider, note } (or { country | toll_free, provider, note })."
          }
        }
      },
      "NumberDeliveryRate": {
        "type": "object",
        "description": "Texts from the number over one window.",
        "properties": {
          "delivered": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "blocked": {
            "type": "integer",
            "description": "Held back by Ready before the carrier."
          },
          "pending": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "delivered_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "Percent of texts with a final status, or null when none has one."
          },
          "failed_pct": {
            "type": [
              "number",
              "null"
            ]
          },
          "pending_pct": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "NumberDeliverability": {
        "type": "object",
        "required": [
          "success",
          "phone"
        ],
        "description": "Sent at the top level, not inside data.",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "phone": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "phone_number": {
                "type": "string"
              },
              "friendly_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": "string"
              },
              "health_score": {
                "type": "integer",
                "description": "0 to 100: 100 with no text spam report, 40 off per report. 70 or more reads Healthy."
              },
              "total_delivered": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Counted since the number was added or its reputation was last reset, and recounted daily. Use delivery_rate_* for a window."
              },
              "total_failed": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Counted since the number was added or its reputation was last reset, and recounted daily. Use delivery_rate_* for a window."
              },
              "total_spam_reports": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Counted since the number was added or its reputation was last reset, and recounted daily. Use delivery_rate_* for a window."
              },
              "created_at": {
                "type": "string"
              }
            }
          },
          "delivery_rate_24h": {
            "$ref": "#/components/schemas/NumberDeliveryRate"
          },
          "delivery_rate_7d": {
            "$ref": "#/components/schemas/NumberDeliveryRate"
          },
          "delivery_rate_30d": {
            "$ref": "#/components/schemas/NumberDeliveryRate"
          },
          "carrier_breakdown_7d": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "carrier": {
                  "type": "string",
                  "description": "Display name, like T-Mobile or Unknown carrier."
                },
                "total": {
                  "type": "string",
                  "description": "A string of digits, not an integer."
                },
                "delivered": {
                  "type": "string"
                },
                "failed": {
                  "type": "string"
                },
                "pending": {
                  "type": "string"
                }
              }
            }
          },
          "top_errors_7d": {
            "type": "array",
            "description": "Most failures first.",
            "items": {
              "type": "object",
              "properties": {
                "error_name": {
                  "type": "string",
                  "description": "The carrier's own error name; informational, do not branch on it."
                },
                "carrier": {
                  "type": "string"
                },
                "count": {
                  "type": "string",
                  "description": "A string of digits."
                },
                "explanation": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "{ title, body, reason, severity, fix_action }, or null. Branch on fix_action.",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "body": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "severity": {
                      "type": "string"
                    },
                    "fix_action": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "sms_spam": {
            "type": "object",
            "description": "The last saved web spam check.",
            "properties": {
              "spam_detected": {
                "type": "boolean"
              },
              "reports": {
                "type": "integer"
              },
              "score": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "checked_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "caller_spam": {
            "type": "object",
            "properties": {
              "flagged": {
                "type": "boolean",
                "description": "Whether carriers label calls from it Spam Likely."
              },
              "flagged_by": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "flagged_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "NumberSpamCheck": {
        "type": "object",
        "description": "A live check, or (with cached true) the saved result: then only spam_detected, reports, checked_at and cached are sent.",
        "properties": {
          "checked": {
            "type": "boolean"
          },
          "data_complete": {
            "type": "boolean"
          },
          "phone_number": {
            "type": "string"
          },
          "spam_score": {
            "type": "number",
            "description": "Higher is worse."
          },
          "status": {
            "type": "string",
            "description": "clean, low_risk, medium_risk, high_risk, or unknown when the search could not finish (not a clean result, not saved)."
          },
          "total_web_mentions": {
            "type": "integer"
          },
          "text_reports": {
            "type": "integer"
          },
          "call_reports": {
            "type": "integer"
          },
          "recent_reports": {
            "type": "integer"
          },
          "distinct_sources": {
            "type": "integer"
          },
          "spam_sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "link": {
                  "type": "string"
                },
                "snippet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "description": "text, call, mixed or unknown."
                },
                "text_reports": {
                  "type": "integer"
                },
                "date": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "YYYY-MM-DD or null."
                }
              }
            }
          },
          "checked_at": {
            "type": "string",
            "description": "ISO 8601."
          },
          "note": {
            "type": "string",
            "description": "Only on an invalid number."
          },
          "message": {
            "type": "string",
            "description": "On an unknown status: why it is not a clean result."
          },
          "cached": {
            "type": "boolean",
            "description": "true when the saved result was answered instead of a new search."
          },
          "spam_detected": {
            "type": "boolean",
            "description": "On a cached answer."
          },
          "reports": {
            "type": "integer",
            "description": "On a cached answer."
          }
        }
      },
      "PortRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "description": "submitted means waiting for Ready to file it and still cancellable; rejected comes with a reason. Other values: see docs."
          },
          "country": {
            "type": "string"
          },
          "current_carrier": {
            "type": "string"
          },
          "account_name": {
            "type": "string"
          },
          "service_address": {
            "type": "string"
          },
          "authorized_name": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "cutover_on": {
            "type": [
              "string",
              "null"
            ],
            "description": "YYYY-MM-DD."
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "numbers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "phone_number": {
                  "type": "string"
                },
                "phone_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The number id once it is on Ready."
                }
              }
            }
          }
        }
      },
      "SmsProtection": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether Ready replaces a flagged number now."
          },
          "source": {
            "type": "string",
            "description": "explicit_opt_in, explicit_opt_out, not_opted_in or unknown."
          },
          "swaps_paused": {
            "type": "boolean",
            "description": "true while automatic replacements are paused for every account."
          },
          "explicitly_enabled": {
            "type": "boolean",
            "description": "The stored switch."
          },
          "attested": {
            "type": "boolean",
            "description": "Whether the account holder authorized replacements."
          },
          "attested_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "attestation_required_to_enable": {
            "type": "boolean"
          },
          "attestation_text": {
            "type": "string",
            "description": "The sentence the account holder agrees to in the app."
          },
          "replacement_price_cents": {
            "type": "integer",
            "description": "The monthly price of a replacement number, in cents."
          }
        }
      },
      "OptOutStatus": {
        "type": "object",
        "required": [
          "phone",
          "opted_out",
          "since"
        ],
        "properties": {
          "phone": {
            "type": "string",
            "description": "The number checked, E.164."
          },
          "opted_out": {
            "type": "boolean",
            "description": "true when the send gate refuses this number for opt-out reasons: a STOP, an opted-out or Do Not Disturb contact, a ban list entry (which keeps a deleted contact's STOP), or a STOP held on another account of the same agency."
          },
          "since": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the number opted out (the contact's opt_out_at, ISO 8601). null when not opted out or when Ready holds no opt-out time, for example a deleted contact."
          }
        }
      },
      "OptOutListItem": {
        "type": "object",
        "required": [
          "phone",
          "since"
        ],
        "properties": {
          "phone": {
            "type": "string",
            "description": "The opted-out number, E.164."
          },
          "since": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the contact opted out (ISO 8601). On a ban_list item it is when the number was added to the ban list. null when Ready has no time."
          },
          "source": {
            "type": "string",
            "description": "Only with scope=all: contact for an opted-out contact, ban_list for a ban list entry."
          }
        }
      },
      "ScrubResult": {
        "type": "object",
        "required": [
          "phone",
          "normalized",
          "valid",
          "litigator",
          "dnc_complainer",
          "federal_dnc",
          "state_dnc",
          "blocked",
          "cached",
          "scrubbed_at"
        ],
        "properties": {
          "phone": {
            "description": "The number as you sent it.",
            "type": [
              "string",
              "number"
            ]
          },
          "normalized": {
            "type": [
              "string",
              "null"
            ],
            "description": "The number in E.164 form, or null when it is not a US number with 10 digits."
          },
          "valid": {
            "type": "boolean",
            "description": "false when the number could not be read as a US number. Such a number is not scrubbed or charged."
          },
          "litigator": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Matched the TCPA litigator list. null when not checked."
          },
          "dnc_complainer": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Matched the Do Not Call complainer list. null when not checked."
          },
          "federal_dnc": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Matched the federal Do Not Call list. null when the account does not screen this list, or the number was not checked."
          },
          "state_dnc": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Matched a state Do Not Call list. null when the account does not screen this list, or the number was not checked."
          },
          "blocked": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "true when Ready will refuse to text this number because of a list match. null when the number was not checked."
          },
          "cached": {
            "type": "boolean",
            "description": "true when the answer came from a cached earlier scrub."
          },
          "scrubbed_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the number was scrubbed, ISO 8601. null when it was not checked."
          },
          "code": {
            "type": "string",
            "description": "Present only on a problem: invalid_number (not charged), scrub_failed, scrub_unavailable (not checked, not charged) or insufficient_balance (balance ran out during the call; not checked, not charged)."
          },
          "error_code": {
            "type": "string",
            "description": "The same value as code."
          },
          "error": {
            "type": "string",
            "description": "A sentence describing the problem, present with code."
          }
        }
      },
      "ScrubBatch": {
        "type": "object",
        "required": [
          "total",
          "results"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "How many numbers were in the request."
          },
          "results": {
            "type": "array",
            "description": "One result per number sent, in the order sent.",
            "items": {
              "$ref": "#/components/schemas/ScrubResult"
            }
          }
        }
      },
      "NightTexting": {
        "type": "object",
        "required": [
          "enabled",
          "signed_at",
          "attestation_text",
          "attestation_version",
          "required_phrase"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "true while texting at night is on. Off by default."
          },
          "signed_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was turned on, ISO 8601, or null while off."
          },
          "attestation_text": {
            "type": "string",
            "description": "The statement the caller agrees to when turning it on."
          },
          "attestation_version": {
            "type": "string",
            "description": "Which wording attestation_text is."
          },
          "required_phrase": {
            "type": "string",
            "description": "The confirmation_text that turning it on needs (I UNDERSTAND)."
          }
        }
      },
      "Registration": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The registration_id: the :id in the registration paths, not a carrier id. Absent when status is not_started."
          },
          "status": {
            "type": "string",
            "description": "Where the brand or campaign stands. Known values: not_started, pending, draft, submitted, awaiting_brand, approved, rejected, suspended, deregistered, archived, deleted, cancelled. The set is open; treat an unknown value as not sending. Decide whether to send with can_send_registered, not this field."
          },
          "carrier_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "The carrier's own stage word, passed through as it arrives (for example VERIFIED, REGISTERED, REJECTED). Open set; do not match on it."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the registration was filed, ISO 8601."
          },
          "approved_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the carriers approved it, ISO 8601."
          },
          "type": {
            "type": "string",
            "description": "brand or campaign. Present on items of registrations."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "On data.campaign, the carrier campaign name. On items of registrations, the label set by rename, else the campaign or business name."
          },
          "campaign_description": {
            "type": [
              "string",
              "null"
            ],
            "description": "On a campaign: the description it was filed with. Read only."
          },
          "sample_messages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "On a campaign: the sample messages it was filed with. Empty when none were saved. Read only."
          },
          "optin_text": {
            "type": [
              "string",
              "null"
            ],
            "description": "On a campaign: the opt-in wording it was filed with. Read only."
          },
          "history": {
            "type": "array",
            "description": "Present on items of registrations: the status moves recorded for it, oldest first, the latest 10. Empty when none are recorded. Read only.",
            "items": {
              "type": "object",
              "properties": {
                "from": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The status it moved from; null for the first."
                },
                "to": {
                  "type": "string",
                  "description": "The status it moved to."
                },
                "at": {
                  "type": "string",
                  "description": "When it moved, ISO 8601."
                }
              }
            }
          },
          "rejection_reason": {
            "type": "string",
            "description": "On a rejected registration: the carrier's text, one reason per line, as CODE: text when the carrier gives a code."
          },
          "rejection_detail": {
            "type": "string",
            "description": "On a rejected registration: the same in plain English."
          },
          "rejection_suggested_fix": {
            "type": [
              "string",
              "null"
            ],
            "description": "An AI suggested fix when one exists. A suggestion, not the carrier's reason."
          },
          "rejection_help": {
            "type": "string",
            "description": "On a rejected registration: what to fix and how to resubmit."
          }
        }
      },
      "RegistrationStatus": {
        "type": "object",
        "required": [
          "brand",
          "campaign",
          "can_send_registered",
          "registrations"
        ],
        "properties": {
          "brand": {
            "$ref": "#/components/schemas/Registration",
            "description": "The most recent brand, or {\"status\":\"not_started\"}."
          },
          "campaign": {
            "$ref": "#/components/schemas/Registration",
            "description": "The most recent campaign, or {\"status\":\"not_started\"}."
          },
          "can_send_registered": {
            "type": "boolean",
            "description": "Whether the account can send US texts now at registered throughput. The one field to check before sending."
          },
          "us_registration": {
            "type": "object",
            "description": "Who US registration covers. It applies only to texts to US and Canadian phones; texts to AU and GB phones need none, so not_started is not a blocker for them. Read only.",
            "properties": {
              "applies_to": {
                "type": "string",
                "description": "The recipients US registration covers."
              },
              "not_needed_for": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Recipient country codes that need no US registration."
              },
              "note": {
                "type": "string",
                "description": "The same in a sentence."
              }
            }
          },
          "registrations": {
            "type": "array",
            "description": "Every brand and campaign shown on the Registration page, newest first (approved first across an agency). Unpaid and cancelled ones are left out.",
            "items": {
              "$ref": "#/components/schemas/Registration"
            }
          }
        }
      },
      "RegistrationRequirements": {
        "type": "object",
        "required": [
          "use_cases",
          "brand_required",
          "campaign_required",
          "auto_filled",
          "pricing_usd",
          "sample_messages",
          "consent_required",
          "note"
        ],
        "properties": {
          "use_cases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Valid campaign use_case values."
          },
          "brand_required": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Fields POST /v1/registration/brand must include."
          },
          "campaign_required": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Fields POST /v1/registration/campaign must include."
          },
          "auto_filled": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Fields Ready fills in, each with a sentence explaining it. Leave them blank."
          },
          "pricing_usd": {
            "type": "object",
            "description": "This account's prices in dollars.",
            "properties": {
              "brand": {
                "type": "object",
                "properties": {
                  "setup": {
                    "type": "number",
                    "description": "One-time setup price in dollars, usually 0."
                  },
                  "monthly": {
                    "type": "number",
                    "description": "Brand monthly price in dollars."
                  },
                  "first_month": {
                    "type": "number",
                    "description": "First month charged at brand submit, in dollars."
                  }
                }
              },
              "campaign": {
                "type": "object",
                "properties": {
                  "setup": {
                    "type": "number",
                    "description": "Always 0."
                  },
                  "monthly": {
                    "type": "number",
                    "description": "What an extra campaign adds per month, in dollars."
                  }
                }
              },
              "vetting": {
                "type": "object",
                "properties": {
                  "standard": {
                    "type": "number",
                    "description": "Standard vetting fee in dollars."
                  },
                  "enhanced": {
                    "type": "number",
                    "description": "Enhanced vetting fee in dollars. An upgrade from Standard costs the difference."
                  }
                }
              },
              "priority": {
                "type": "number",
                "description": "Priority Registration fee in dollars, added when a brand is sent with rush: true. Absent when not offered."
              }
            }
          },
          "sample_messages": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "For each use case, the two sample message bodies a campaign of it is filed with."
          },
          "consent_required": {
            "type": "boolean",
            "description": "Always true on success."
          },
          "note": {
            "type": "string",
            "description": "A plain sentence on how payment works."
          }
        }
      },
      "RegistrationCheckoutResult": {
        "type": "object",
        "description": "One of three shapes: charged now (charged, amount, card_brand, card_last4, registration_id), a payment to confirm (client_secret, payment_intent_id, amount, monthly, label, has_card), or no fee due (zero_fee, registration_id). A test key answers test: true with registration_id null.",
        "properties": {
          "charged": {
            "type": "boolean",
            "description": "true when the card on file was charged now."
          },
          "amount": {
            "type": "integer",
            "description": "Amount charged or to be confirmed, in cents (includes the priority fee when rush: true)."
          },
          "monthly": {
            "type": "integer",
            "description": "The monthly fee in cents."
          },
          "card_brand": {
            "type": "string",
            "description": "Card brand of the card charged or to confirm."
          },
          "card_last4": {
            "type": "string",
            "description": "Last four digits of that card."
          },
          "registration_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The new registration's id. null for a test key. Absent when a payment still needs confirming; it comes back from POST /v1/registration/confirm."
          },
          "client_secret": {
            "type": "string",
            "description": "Present when the saved card needs authentication: confirm it in the app, then call POST /v1/registration/confirm."
          },
          "payment_intent_id": {
            "type": "string",
            "description": "The payment to pass to POST /v1/registration/confirm."
          },
          "label": {
            "type": "string",
            "description": "Registration for a brand, Campaign Registration for a campaign."
          },
          "has_card": {
            "type": "boolean",
            "description": "Whether a saved card is on file."
          },
          "payment_method_id": {
            "type": "string",
            "description": "The saved card's payment method, when has_card is true."
          },
          "saved_card_declined": {
            "type": "boolean",
            "description": "true when the saved card was declined; send the customer to add a different card."
          },
          "decline_code": {
            "type": "string",
            "description": "The decline reason when saved_card_declined is true."
          },
          "zero_fee": {
            "type": "boolean",
            "description": "true when no fee was due and the registration was submitted at once."
          },
          "type": {
            "type": "string",
            "description": "brand or campaign (test key answers)."
          },
          "status": {
            "type": "string",
            "description": "pending (test key answers)."
          },
          "test": {
            "type": "boolean",
            "description": "true for a test key: validated only, nothing created or charged."
          },
          "note": {
            "type": "string",
            "description": "A sentence on a test key answer."
          }
        }
      },
      "RegistrationConfirmResult": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true on success."
          },
          "registration_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The registration filed. null for a test key."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "brand or campaign."
          },
          "already_processed": {
            "type": "boolean",
            "description": "true when this payment was already applied (a repeat call)."
          },
          "data": {
            "type": "object",
            "properties": {
              "registration_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Same as the top level."
              },
              "type": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Same as the top level."
              },
              "already_processed": {
                "type": "boolean",
                "description": "Same as the top level."
              },
              "test": {
                "type": "boolean",
                "description": "true for a test key."
              },
              "note": {
                "type": "string",
                "description": "A sentence on a test key answer."
              }
            }
          }
        }
      },
      "RegistrationResubmitResult": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true on success."
          },
          "reg_id": {
            "type": "integer",
            "description": "The registration id (older name)."
          },
          "registration_id": {
            "type": "integer",
            "description": "The registration id; read this one."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "brand or campaign."
          },
          "status": {
            "type": "string",
            "description": "The registration status after the call, for example pending."
          },
          "submit": {
            "type": "object",
            "properties": {
              "ok": {
                "type": "boolean",
                "description": "Whether the step succeeded."
              },
              "status": {
                "type": "string",
                "description": "resubmitted, filed_register_pending, already_approved, in_progress, waiting_for_brand or manual_fix."
              }
            }
          },
          "message": {
            "type": "string",
            "description": "A sentence to show."
          },
          "test": {
            "type": "boolean",
            "description": "true for a test key: nothing resubmitted."
          },
          "data": {
            "type": "object",
            "description": "Present on a test key answer only."
          }
        }
      },
      "RegistrationDenied": {
        "type": "object",
        "required": [
          "denied"
        ],
        "properties": {
          "denied": {
            "type": "boolean",
            "description": "true when the account has a rejected registration."
          },
          "reg_id": {
            "type": "integer",
            "description": "The rejected registration's id, for resubmit."
          },
          "type": {
            "type": "string",
            "description": "brand or campaign."
          },
          "name": {
            "type": "string",
            "description": "The registration's label."
          },
          "reasons": {
            "type": "string",
            "description": "The carrier's text (same as rejection_reason in GET /v1/registration)."
          },
          "reason": {
            "type": "string",
            "description": "The same in plain English."
          },
          "ai_fix": {
            "type": [
              "object",
              "null"
            ],
            "description": "An AI suggested fix with summary, checklist, suggested_fields and auto_fixable, or null."
          }
        }
      },
      "RegistrationThroughput": {
        "type": "object",
        "properties": {
          "throttled": {
            "type": "boolean",
            "description": "true when rejections in the last 24 hours are high enough to throttle."
          },
          "total_24h": {
            "type": "integer",
            "description": "Messages in the last 24 hours."
          },
          "rejected_24h": {
            "type": "integer",
            "description": "Rejected messages in the last 24 hours."
          },
          "reject_pct": {
            "type": "number",
            "description": "Percent rejected."
          },
          "daily_loss_usd": {
            "type": "number",
            "description": "Estimated daily cost of the rejections, in dollars."
          },
          "brand": {
            "type": [
              "object",
              "null"
            ],
            "description": "When throttled, the brand to vet: name, cta (vet, upgrade or maxed) and price_usd (dollars, null when maxed)."
          },
          "tmobile": {
            "type": [
              "object",
              "null"
            ],
            "description": "Daily cap for the tmobile network: daily_cap, tier, next_cap (null at the top), sent_today, pct, coverage, usage_reliable. Read sent_today only when usage_reliable is true. null until the account has a tier."
          },
          "ramp": {
            "type": "object",
            "description": "Warm-up state: in_warmup (null with ramp_unavailable: true when unreadable), sent, cap, remaining, capped, ends_at (an estimate), and registration_id, carrier_campaign_id, campaign_id (always null) and campaigns (always empty)."
          }
        }
      },
      "RegistrationLimitsCampaign": {
        "type": "object",
        "required": [
          "id",
          "status",
          "source"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The campaign's registration id."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The campaign name."
          },
          "status": {
            "type": "string",
            "description": "The campaign's status. Includes unpaid (pending_payment) and cancelled campaigns."
          },
          "source": {
            "type": "string",
            "description": "carrier_assignment when Ready read the carrier assignment; not_registered when the campaign is not registered yet."
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When Ready read the assignment, ISO 8601. null when not_registered."
          },
          "carriers": {
            "type": [
              "object",
              "null"
            ],
            "description": "Per network: att {status, message_class, sms_per_minute, sms_per_second, scope: campaign}, tmobile {status, tier, daily_messages, scope: brand; a shared daily allowance for the whole brand, do not add across campaigns}, verizon {status, sms_per_second, scope: campaign}. A null rate means not reported. null when not_registered."
          }
        }
      },
      "RegistrationCarrierLimits": {
        "type": "object",
        "required": [
          "brand",
          "campaigns",
          "has_more",
          "next_after_id"
        ],
        "properties": {
          "brand": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "The brand's registration id."
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The brand name."
              },
              "status": {
                "type": "string",
                "description": "The brand status."
              }
            }
          },
          "campaigns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RegistrationLimitsCampaign"
            },
            "description": "Up to 10 campaigns per page."
          },
          "has_more": {
            "type": "boolean",
            "description": "true when another page exists."
          },
          "next_after_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pass as after_id for the next page."
          },
          "cache_ttl_seconds": {
            "type": "integer",
            "description": "How long results are cached, in seconds."
          }
        }
      },
      "RegistrationVetResult": {
        "type": "object",
        "required": [
          "success"
        ],
        "description": "Fields sit at the top level, not under data. One of: charged now (charged, amount_cents, vetting_type, upgrade, card_last4, payment_intent_id), a payment to confirm (charged: false, client_secret, has_card, payment_intent_id), or sent free (free, charged: false, amount_cents: 0). A test key answers test: true and charges nothing.",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true on success."
          },
          "charged": {
            "type": "boolean",
            "description": "Whether the card was charged now."
          },
          "amount_cents": {
            "type": "integer",
            "description": "The vetting fee in cents."
          },
          "vetting_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "STANDARD or ENHANCED."
          },
          "upgrade": {
            "type": "boolean",
            "description": "true for an upgrade from STANDARD to ENHANCED (you pay the difference)."
          },
          "card_last4": {
            "type": "string",
            "description": "Last four digits of the card charged."
          },
          "payment_intent_id": {
            "type": "string",
            "description": "Pass to POST /v1/registration/{id}/vet/confirm when a client_secret came back."
          },
          "client_secret": {
            "type": "string",
            "description": "Present when the saved card needs confirming in the app first."
          },
          "has_card": {
            "type": "boolean",
            "description": "Whether a saved card is on file."
          },
          "free": {
            "type": "boolean",
            "description": "true when vetting was sent with no charge."
          },
          "free_revet": {
            "type": "boolean",
            "description": "true on the one free re-vet after a paid vetting the carriers did not pass."
          },
          "test": {
            "type": "boolean",
            "description": "true for a test key."
          },
          "data": {
            "type": "object",
            "description": "Present on a test key answer only."
          }
        }
      },
      "RegistrationVetConfirmResult": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true on success."
          },
          "charged": {
            "type": "boolean",
            "description": "true when the vetting was sent now."
          },
          "vetting_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "STANDARD or ENHANCED."
          },
          "upgrade": {
            "type": "boolean",
            "description": "true for an upgrade."
          },
          "already_processed": {
            "type": "boolean",
            "description": "true when this payment's vetting was already sent (a repeat call)."
          },
          "refunded": {
            "type": "boolean",
            "description": "With already_processed, when another payment had already bought the vetting: whether this one was refunded."
          },
          "message": {
            "type": "string",
            "description": "A sentence to show."
          },
          "test": {
            "type": "boolean",
            "description": "true for a test key."
          },
          "data": {
            "type": "object",
            "description": "Present on a test key answer only."
          }
        }
      },
      "RegistrationRename": {
        "type": "object",
        "required": [
          "id",
          "display_name"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The registration id."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The new label."
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The same label, for older callers."
          },
          "reg_id": {
            "type": "integer",
            "description": "Present on a test key answer."
          },
          "test": {
            "type": "boolean",
            "description": "true for a test key."
          }
        }
      },
      "RegistrationDeregisterResult": {
        "type": "object",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true on success."
          },
          "dry_run": {
            "type": "boolean",
            "description": "true on a dry run."
          },
          "data": {
            "type": "object",
            "description": "On a dry run only.",
            "properties": {
              "name": {
                "type": "string",
                "description": "The business name to send back as confirm_name."
              },
              "numbers": {
                "type": "integer",
                "description": "How many numbers are on the registration."
              }
            }
          },
          "message": {
            "type": "string",
            "description": "A sentence, on some outcomes."
          }
        }
      },
      "RegistrationTransferResult": {
        "type": "object",
        "properties": {
          "transferred_to": {
            "type": "string",
            "description": "The sub-account's company name."
          },
          "registrations_moved": {
            "type": "integer",
            "description": "How many registrations moved (this one and the rest of its brand)."
          },
          "numbers_moved": {
            "type": "integer",
            "description": "How many numbers moved."
          },
          "ghl_relinked": {
            "type": "integer",
            "description": "How many moved numbers were relinked to the sub-account's GoHighLevel location."
          }
        }
      },
      "RegistrationOptinUrl": {
        "type": "object",
        "required": [
          "registration_id",
          "status",
          "slug",
          "public_url"
        ],
        "properties": {
          "registration_id": {
            "type": "integer",
            "description": "The registration the page belongs to."
          },
          "brand_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The brand's trade name, or its company name."
          },
          "status": {
            "type": "string",
            "description": "The registration's status."
          },
          "slug": {
            "type": "string",
            "description": "The page's short name in its link."
          },
          "public_url": {
            "type": "string",
            "description": "The full link to the hosted opt-in page."
          }
        }
      },
      "ValidationResult": {
        "type": "object",
        "required": [
          "phone",
          "normalized",
          "valid",
          "line_type",
          "carrier",
          "carrier_slug",
          "textable",
          "cached",
          "checked_at"
        ],
        "properties": {
          "phone": {
            "description": "The number as you sent it.",
            "type": [
              "string",
              "number"
            ]
          },
          "normalized": {
            "type": [
              "string",
              "null"
            ],
            "description": "E.164, or null when the number cannot be read."
          },
          "valid": {
            "type": "boolean",
            "description": "false when malformed or disconnected."
          },
          "reason": {
            "type": "string",
            "description": "Only when valid is false: invalid_format, unsupported_country, restricted_number, fictional_number or disconnected. More may be added; treat an unknown reason as not textable. Every reason but disconnected is answered without a lookup and not billed."
          },
          "line_type": {
            "type": "string",
            "description": "mobile, landline or unknown. A line reported only as landline or other (most VoIP) reads as unknown and is still billed."
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ],
            "description": "Carrier name for mobile numbers. Free text; do not compare it for equality."
          },
          "carrier_slug": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable value to compare: tmobile, att, verizon or other. null when carrier is null."
          },
          "textable": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the number can get texts. null when the lookup gave no answer or line_type is unknown. false when not valid."
          },
          "cached": {
            "type": "boolean",
            "description": "Whether the answer came from the shared cache. Cached answers are billed too."
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was checked, ISO 8601. null for a well-formed number means no answer came back, so it was not billed."
          }
        }
      },
      "ReportDailyRow": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The day, YYYY-MM-DD."
          },
          "complete": {
            "type": "boolean",
            "description": "false for today."
          },
          "sms_sent": {
            "type": "integer",
            "description": "Texts handed to the carrier, MMS not included."
          },
          "sms_segments_sent": {
            "type": "integer",
            "description": "Segments of those texts."
          },
          "sms_delivered": {
            "type": "integer",
            "description": "Of those, delivered so far."
          },
          "replies": {
            "type": "integer",
            "description": "Inbound messages, opt-outs not included."
          },
          "positive_replies": {
            "type": "integer",
            "description": "Positive replies that day."
          },
          "inbound_messages": {
            "type": "integer",
            "description": "Every inbound text, opt-outs included."
          },
          "inbound_segments": {
            "type": "integer",
            "description": "Segments of every inbound text."
          },
          "opt_outs": {
            "type": "integer",
            "description": "Opt-out events recorded that day from any source; a contact who opts out twice counts twice."
          },
          "sms_cost_usd": {
            "type": "string",
            "description": "Outbound SMS with carrier fees, dollars as a decimal string (\"0\" or four decimals)."
          },
          "screening_cost_usd": {
            "type": "string",
            "description": "Number validation and scrubbing, dollars as a decimal string."
          },
          "total_usage_cost_usd": {
            "type": "string",
            "description": "All usage, dollars as a decimal string, net of refunds."
          },
          "refunds_usd": {
            "type": "string",
            "description": "How much was given back that day, dollars as a decimal string."
          }
        },
        "required": [
          "date",
          "complete",
          "sms_sent",
          "sms_segments_sent",
          "sms_delivered",
          "replies",
          "positive_replies",
          "inbound_messages",
          "inbound_segments",
          "opt_outs",
          "sms_cost_usd",
          "screening_cost_usd",
          "total_usage_cost_usd",
          "refunds_usd"
        ]
      },
      "ReportDaily": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Always true on success."
          },
          "account_id": {
            "type": "integer",
            "description": "The account the report is for."
          },
          "timezone": {
            "type": "string",
            "description": "The IANA time zone the days are counted in."
          },
          "from": {
            "type": "string",
            "description": "First day covered, YYYY-MM-DD."
          },
          "to": {
            "type": "string",
            "description": "Last day covered, YYYY-MM-DD."
          },
          "generated_at": {
            "type": "string",
            "description": "When the report was read, ISO 8601."
          },
          "currency": {
            "type": "string",
            "description": "Always USD."
          },
          "cost_scope": {
            "type": "string",
            "description": "Always attributed_usage_only."
          },
          "cost_basis": {
            "type": "string",
            "description": "Always net_of_refunds."
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the costs leave out, in plain words."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportDailyRow"
            },
            "description": "One row per calendar day, oldest first, zero filled."
          }
        },
        "required": [
          "success",
          "account_id",
          "timezone",
          "from",
          "to",
          "generated_at",
          "currency",
          "cost_scope",
          "cost_basis",
          "limitations",
          "data"
        ]
      },
      "ReportOverview": {
        "type": "object",
        "properties": {
          "messages_sent": {
            "type": "integer",
            "description": "Texts sent in the period."
          },
          "outside_sent": {
            "type": "integer",
            "description": "Of messages_sent, texts sent outside Ready added as a staff audited adjustment. 0 for assigned contacts only."
          },
          "segments_sent": {
            "type": "integer",
            "description": "Segments out."
          },
          "segments_received": {
            "type": "integer",
            "description": "Segments in."
          },
          "delivered": {
            "type": "integer",
            "description": "Texts delivered. Includes texts sent outside Ready that staff added as an audited adjustment (see outside_sent)."
          },
          "failed": {
            "type": "integer",
            "description": "Texts failed."
          },
          "no_receipt": {
            "type": "integer",
            "description": "Texts with no final receipt yet."
          },
          "delivery_rate": {
            "type": "number",
            "description": "Delivered out of sent, as a percent."
          },
          "replies": {
            "type": "integer",
            "description": "People who replied."
          },
          "reply_rate": {
            "type": "number",
            "description": "Replies out of delivered, as a percent."
          },
          "positive_replies": {
            "type": "integer",
            "description": "Positive replies."
          },
          "positive_reply_rate": {
            "type": "number",
            "description": "Positive replies out of delivered, as a percent."
          },
          "opt_outs": {
            "type": "integer",
            "description": "Contacts opted out now that opted out in the period, counted once each."
          },
          "opt_out_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Opt-outs out of delivered, as a percent. null when nothing was delivered."
          },
          "blocked": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Sends Ready stopped before they went out."
          },
          "total_spent": {
            "type": [
              "number",
              "null"
            ],
            "description": "Spend in dollars. null when spend is hidden (a sub-account its agency pays for, or a key user who sees only assigned contacts)."
          },
          "cost_per_message": {
            "type": [
              "number",
              "null"
            ],
            "description": "Spend per text sent, dollars. null when spend is hidden."
          },
          "cost_per_delivered": {
            "type": [
              "number",
              "null"
            ],
            "description": "Spend per text delivered, dollars. null when spend is hidden or nothing was delivered."
          },
          "assigned_only": {
            "type": "boolean",
            "description": "Present and true only when the totals cover the key user's assigned contacts."
          }
        }
      },
      "ReportCallsSummary": {
        "type": "object",
        "properties": {
          "dials": {
            "type": "integer",
            "description": "Calls placed."
          },
          "conversations": {
            "type": "integer",
            "description": "Calls that became a conversation."
          },
          "talk_seconds": {
            "type": "integer",
            "description": "Seconds spent in those conversations."
          },
          "interested": {
            "type": "integer",
            "description": "Calls marked interested."
          },
          "per_lead": {
            "type": "object",
            "properties": {
              "leads": {
                "type": "integer"
              },
              "reached": {
                "type": "integer"
              },
              "new_leads": {
                "type": "integer"
              },
              "new_reached": {
                "type": "integer"
              }
            },
            "description": "Pickup per lead: leads called, leads reached, and the same for leads created in the window. Not in the docs."
          },
          "scope": {
            "type": "string",
            "description": "team, or rep when the key user is limited to their assigned contacts."
          },
          "assigned_only": {
            "type": "boolean",
            "description": "Present and true only when the key user sees only their assigned contacts."
          }
        },
        "required": [
          "dials",
          "conversations",
          "talk_seconds",
          "interested",
          "scope"
        ]
      },
      "ReportCallsDay": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The day, YYYY-MM-DD."
          },
          "dials": {
            "type": "integer",
            "description": "Calls placed that day."
          },
          "conversations": {
            "type": "integer",
            "description": "Of those, calls that became a conversation."
          },
          "talk_seconds": {
            "type": "integer",
            "description": "Seconds of conversation that day."
          }
        },
        "required": [
          "date",
          "dials",
          "conversations"
        ]
      },
      "ReportCallOutcomeCounts": {
        "type": "object",
        "additionalProperties": {
          "type": "integer"
        },
        "description": "Calls per outcome bucket. Keys: interested, callback, not_interested, voicemail, no_answer, wrong_number, dq, answered, screened, none, other. A logged outcome wins over what the phone network reported; none is a call with neither, other an older outcome the app no longer offers. Every key is present, 0 when none."
      },
      "ReportCallsOutcomes": {
        "type": "object",
        "properties": {
          "dials": {
            "type": "integer",
            "description": "Calls placed in the window."
          },
          "counts": {
            "$ref": "#/components/schemas/ReportCallOutcomeCounts"
          },
          "other_total": {
            "type": "integer",
            "description": "Calls whose outcome is not one the app offers today."
          }
        },
        "required": [
          "dials",
          "counts"
        ]
      },
      "ReportCallsRep": {
        "type": "object",
        "properties": {
          "rep_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The rep's user id. null for calls no rep placed."
          },
          "name": {
            "type": "string",
            "description": "The rep's name, or their email when they have no name."
          },
          "dials": {
            "type": "integer"
          },
          "conversations": {
            "type": "integer"
          },
          "talk_seconds": {
            "type": "integer"
          },
          "interested": {
            "type": "integer"
          }
        },
        "required": [
          "rep_id",
          "name",
          "dials",
          "conversations",
          "talk_seconds",
          "interested"
        ]
      },
      "ReportCallsLine": {
        "type": "object",
        "properties": {
          "from_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The calling number (E.164). null for calls with no recorded number. Pass it as from_number to the call list."
          },
          "dials": {
            "type": "integer"
          },
          "conversations": {
            "type": "integer"
          },
          "talk_seconds": {
            "type": "integer"
          },
          "counts": {
            "$ref": "#/components/schemas/ReportCallOutcomeCounts"
          },
          "other_total": {
            "type": "integer",
            "description": "Calls whose outcome is not one the app offers today."
          }
        },
        "required": [
          "from_number",
          "dials",
          "conversations",
          "talk_seconds",
          "counts",
          "other_total"
        ]
      },
      "ReportCallRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The call's id (a number, not the out_ id of GET /v1/calls)."
          },
          "created_at": {
            "type": "string",
            "description": "When the call was placed."
          },
          "to_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The number called (E.164)."
          },
          "from_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The number it was placed from (E.164)."
          },
          "contact_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "contact_name": {
            "type": "string",
            "description": "The contact's name; empty when unknown."
          },
          "rep_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The rep who placed it."
          },
          "rep_name": {
            "type": "string",
            "description": "The rep's name; empty when unknown."
          },
          "duration": {
            "type": "integer",
            "description": "Seconds."
          },
          "outcome": {
            "type": "string",
            "description": "One of the outcome keys of calls by outcome."
          },
          "disposition": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the rep logged."
          },
          "call_result": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the phone network reported."
          },
          "notes": {
            "type": "string",
            "description": "Notes as stored, possibly ending with a bracketed tag Ready adds such as [Failed: ...]. Empty when none."
          },
          "notes_plain": {
            "type": [
              "string",
              "null"
            ],
            "description": "The rep's text alone, without Ready's tags. Show this to people."
          },
          "fail_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the call failed, in the calling network's own words."
          },
          "fail_reason_words": {
            "type": [
              "string",
              "null"
            ],
            "description": "The same reason as a sentence a person can read."
          },
          "recording_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "recording_lost": {
            "type": "boolean",
            "description": "true when a recording was made but can no longer be played."
          },
          "channel": {
            "type": "string",
            "description": "phone or facetime."
          }
        },
        "required": [
          "id",
          "created_at",
          "duration",
          "outcome",
          "notes",
          "recording_lost",
          "channel"
        ]
      },
      "ReportHourlyRow": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "string",
            "description": "The hour, as a UTC timestamp."
          },
          "count": {
            "type": "integer",
            "description": "Texts sent in that hour."
          },
          "delivered": {
            "type": "integer",
            "description": "Of those, delivered so far."
          },
          "failed": {
            "type": "integer",
            "description": "Of those, failed. Not in the docs."
          }
        },
        "required": [
          "hour",
          "count",
          "delivered"
        ]
      },
      "ReportVolumeDay": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The day, YYYY-MM-DD."
          },
          "count": {
            "type": "integer",
            "description": "Texts sent that day."
          },
          "delivered": {
            "type": "integer",
            "description": "Of those, delivered so far."
          }
        },
        "required": [
          "date",
          "count",
          "delivered"
        ]
      },
      "ReportTopCampaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The campaign or drip campaign id."
          },
          "user_id": {
            "type": "integer",
            "description": "The account that sent it: the key's account or a sub-account."
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "blast for a one time campaign, sequence for a drip campaign."
          },
          "created_at": {
            "type": "string"
          },
          "total_sent": {
            "type": "integer",
            "description": "Texts sent in the window."
          },
          "delivered": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "replies": {
            "type": "integer",
            "description": "Contacts who replied."
          },
          "delivery_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Delivered over delivered plus failed, as a percent. null when nothing has resolved."
          },
          "reply_rate": {
            "type": "number",
            "description": "Repliers out of delivered, as a percent. 0 when nothing was delivered."
          }
        },
        "required": [
          "id",
          "user_id",
          "name",
          "kind",
          "total_sent",
          "delivered",
          "failed",
          "replies"
        ]
      },
      "ReportSendWindow": {
        "type": [
          "object",
          "null"
        ],
        "description": "The best sending window found. source is data when it comes from the account's replies, default when there is not enough data (the general 10:00 to 12:00 fallback). null only when it could not be computed.",
        "properties": {
          "source": {
            "type": "string"
          },
          "start_hhmm": {
            "type": "string"
          },
          "end_hhmm": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "sample": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "ReportHourlyPatternRow": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "integer",
            "description": "Hour of the day, 0 to 23."
          },
          "sent": {
            "type": "integer",
            "description": "Texts sent in that hour."
          },
          "replies": {
            "type": "integer",
            "description": "Replies received in that hour."
          },
          "cohort_sent": {
            "type": "integer",
            "description": "Texts sent to a known contact, the base for sent_with_reply."
          },
          "sent_with_reply": {
            "type": "integer",
            "description": "Of those, texts whose contact replied within the attribution window (see docs)."
          }
        },
        "required": [
          "hour",
          "sent",
          "replies"
        ]
      },
      "ReportHeatmapCell": {
        "type": "object",
        "properties": {
          "dow": {
            "type": "integer",
            "description": "Day of the week, 0 for Sunday to 6 for Saturday."
          },
          "hour": {
            "type": "integer",
            "description": "Hour of the day, 0 to 23."
          },
          "n": {
            "type": "integer",
            "description": "Replies in that slot."
          }
        },
        "required": [
          "dow",
          "hour",
          "n"
        ]
      },
      "ReportDeliveryBreakdown": {
        "type": "object",
        "properties": {
          "days": {
            "type": "integer",
            "description": "The window length used."
          },
          "totals": {
            "type": [
              "object",
              "null"
            ],
            "description": "sent, delivered, failed, pending, delivery_rate and failure_rate (percents out of sent). null when the summary part was not asked for.",
            "properties": {
              "sent": {
                "type": "integer"
              },
              "delivered": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "pending": {
                "type": "integer"
              },
              "delivery_rate": {
                "type": "number"
              },
              "failure_rate": {
                "type": "number"
              }
            }
          },
          "daily": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "sent": {
                  "type": "integer"
                },
                "delivered": {
                  "type": "integer"
                },
                "failed": {
                  "type": "integer"
                }
              }
            },
            "description": "One row per day. Empty when the summary part was not asked for."
          },
          "by_reason": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "reason": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "explanation": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "title, body, fix_action and severity in plain words."
                },
                "error_reason": {
                  "type": "string"
                },
                "error_detail": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            },
            "description": "The most common failure reasons. null when not asked for or unavailable."
          },
          "reason_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Failures that have a reason."
          },
          "by_number": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "phone_number": {
                  "type": "string"
                },
                "sent": {
                  "type": "integer"
                },
                "delivered": {
                  "type": "integer"
                },
                "failed": {
                  "type": "integer"
                },
                "delivery_rate": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Out of delivered plus failed."
                }
              }
            },
            "description": "Per sending number. null when not asked for."
          },
          "blocked": {
            "type": [
              "object",
              "null"
            ],
            "description": "Texts Ready held back before sending, as compliance and undeliverable, each with attempts and recipients. Only present for part summary or all; null when unreadable or for a key user who sees only assigned contacts."
          },
          "reasons_unavailable": {
            "type": "boolean",
            "description": "Present and true when the failure reasons could not be read but the rest loaded."
          },
          "note": {
            "type": "string",
            "description": "Present with reasons_unavailable: what to do."
          }
        },
        "required": [
          "days",
          "daily"
        ]
      },
      "ReportDeliverabilityPhone": {
        "type": "object",
        "properties": {
          "from_number": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "delivery_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Out of delivered plus failed."
          },
          "health_score": {
            "type": "number",
            "description": "Only with numbers_only: the number's health score."
          },
          "needs_attention": {
            "type": "boolean",
            "description": "Only with numbers_only."
          },
          "spam_sources_json": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only with numbers_only: the spam reports behind the score as an opaque JSON string."
          }
        }
      },
      "ReportDeliverability": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "summary": {
            "type": "object",
            "description": "Keyed 24h, 7d and 30d; rates out of total (sent).",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "total": {
                  "type": "integer"
                },
                "delivered": {
                  "type": "integer"
                },
                "failed": {
                  "type": "integer"
                },
                "pending": {
                  "type": "integer"
                },
                "delivery_rate": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "failure_rate": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          },
          "failures_by_group": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "status_group": {
                  "type": "string",
                  "description": "UNDELIVERABLE, EXPIRED, REJECTED or UNKNOWN."
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "top_errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "error_name": {
                  "type": "string"
                },
                "error_code": {
                  "type": [
                    "string",
                    "integer",
                    "null"
                  ]
                },
                "status_group": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                },
                "guidance": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "explanation": {},
                "error_reason": {
                  "type": "string",
                  "description": "The stable code GET /v1/messages/{id} gives; group on this."
                }
              }
            },
            "description": "The most common errors with advice."
          },
          "per_phone": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportDeliverabilityPhone"
            },
            "description": "The result per sending number."
          },
          "numbers_only": {
            "type": "boolean",
            "description": "Present and true when only per_phone was asked for."
          },
          "by_carrier": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "carrier": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "total": {
                  "type": "integer"
                },
                "delivered": {
                  "type": "integer"
                },
                "failed": {
                  "type": "integer"
                },
                "pending": {
                  "type": "integer"
                },
                "delivery_rate": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "failure_rate": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            },
            "description": "Per carrier, rates out of delivered plus failed. Small carriers are left out."
          },
          "recent_failures": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "The latest failed texts: id (an internal row id, not a message_id), from_number, to_number, created_at, status_group, status_description, error_detail, error_explanation, provider_error_code, provider_error_name and carrier_error. Read fields by name."
            }
          }
        },
        "required": [
          "success",
          "per_phone"
        ]
      },
      "CallLeg": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "rep or lead."
          },
          "endpoint": {
            "type": "string",
            "description": "Rep leg only: phone or browser."
          },
          "dialed": {
            "type": "boolean",
            "description": "Lead leg only."
          },
          "answered": {
            "type": "boolean"
          },
          "answered_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "confirm_asked": {
            "type": "boolean",
            "description": "Rep leg only: we asked whoever picked up to press 1."
          },
          "confirmed": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Rep leg only: they pressed 1; null when not asked."
          },
          "confirmed_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "ended_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "null while live. Rep: rep_not_confirmed, no_answer, completed or failed. Lead: not_dialed, no_answer, completed or failed."
          }
        },
        "required": [
          "role"
        ]
      },
      "Call": {
        "type": "object",
        "properties": {
          "call_id": {
            "type": "string",
            "description": "out_<n> for a call started by you or the Ready Dialer, in_<n> for a call to one of your numbers, ft_<n> for a FaceTime Audio call. Each prefix has its own numbers."
          },
          "channel": {
            "type": "string",
            "description": "phone or facetime."
          },
          "direction": {
            "type": "string",
            "description": "outbound or inbound."
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who called (E.164)."
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who was called (E.164)."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "The call's state. Outbound: agent_ringing, bridging, ringing, connected, completed, failed. Inbound: received, forwarding, ringing_agent, connecting_agent, answered, missed. FaceTime: initiated, ringing, connected, completed, failed, unknown. See docs."
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ],
            "description": "The call result Ready recorded: answered, voicemail, no_answer, busy, failed or missed. Can be provisional right after a recorded call ends."
          },
          "duration_seconds": {
            "type": "integer",
            "description": "Talk time."
          },
          "disposition": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the agent logged."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "The agent's notes, without Ready's bracketed tags."
          },
          "contact_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "contact_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "agent_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The team member who placed or answered it."
          },
          "agent_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "recording_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "GET /v1/calls/{id}/recording with the same key. null when not recorded."
          },
          "transcript": {
            "type": [
              "string",
              "null"
            ],
            "description": "null until ready, and always null when not recorded or on FaceTime calls. Always English."
          },
          "transcript_starts_ms": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer"
            },
            "description": "When each transcript line starts, in ms into the recording. Only on GET /v1/calls/{id}; list rows do not carry it."
          },
          "created_at": {
            "type": "string",
            "description": "When the call started, ISO 8601."
          },
          "legs": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/CallLeg"
            },
            "description": "Rep leg then lead leg on an out_ call; null otherwise."
          },
          "sub_account_id": {
            "type": "integer",
            "description": "Only in a list read with sub_account: the account the call is on."
          },
          "sub_account_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only with sub_account_id."
          }
        },
        "required": [
          "call_id",
          "channel",
          "direction",
          "duration_seconds",
          "created_at"
        ]
      },
      "CallStartRequest": {
        "type": "object",
        "properties": {
          "to": {
            "type": "string",
            "maxLength": 32,
            "description": "The lead, E.164. US, Canadian, UK or Australian numbers."
          },
          "agent_phone": {
            "type": "string",
            "maxLength": 32,
            "description": "The phone we ring first, usually the team member's cell, E.164. Leave out to ring the verified phone on the key user's profile."
          },
          "from_number_id": {
            "type": [
              "integer",
              "string"
            ],
            "description": "Call from this number id. Leave out and we pick one, preferring a local area code."
          },
          "confirm_answer": {
            "type": "boolean",
            "description": "Default true: whoever picks up agent_phone must press 1 before we dial the lead. false dials the lead as soon as the phone picks up."
          }
        },
        "required": [
          "to"
        ]
      },
      "CallStartResult": {
        "type": "object",
        "properties": {
          "call_id": {
            "type": "string",
            "description": "The out_ id. Use it with get, hang up and outcome."
          },
          "status": {
            "type": "string",
            "description": "Always ringing_agent. The same state GET /v1/calls/{id} reports as agent_ringing."
          },
          "from": {
            "type": "string",
            "description": "The number the lead will see (E.164)."
          },
          "confirm_answer": {
            "type": "boolean",
            "description": "Whether the team member must press 1 before we dial the lead."
          }
        },
        "required": [
          "call_id",
          "status",
          "from",
          "confirm_answer"
        ]
      },
      "CallRecordingPolicy": {
        "type": "object",
        "properties": {
          "record_calls": {
            "type": "boolean",
            "description": "false means no call on the account is recorded."
          },
          "record_every_call": {
            "type": "boolean",
            "description": "Every call is recorded: the Ready Dialer's Record switch is locked on."
          },
          "dual_speaker": {
            "type": "boolean",
            "description": "Each side of a recorded call is kept and transcribed on its own."
          },
          "notice": {
            "type": "boolean",
            "description": "Both people hear the recording notice when the call is answered."
          },
          "signed": {
            "type": [
              "object",
              "null"
            ],
            "description": "When the notice is off and this account signed the waiver: who and when.",
            "properties": {
              "name": {
                "type": "string"
              },
              "at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "attestation": {
            "type": "object",
            "properties": {
              "version": {
                "type": [
                  "string",
                  "integer"
                ]
              },
              "text": {
                "type": "string"
              },
              "min_name_chars": {
                "type": "integer"
              }
            },
            "description": "The waiver statement to show before turning the notice off."
          }
        },
        "required": [
          "record_calls",
          "record_every_call",
          "dual_speaker",
          "notice",
          "signed",
          "attestation"
        ]
      },
      "CallRecordingSettings": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CallRecordingPolicy"
          },
          {
            "type": "object",
            "properties": {
              "can_edit": {
                "type": "boolean",
                "description": "Whether this key may change the settings (owner or admin)."
              }
            },
            "required": [
              "can_edit"
            ]
          }
        ]
      },
      "CallMyRecording": {
        "type": "object",
        "properties": {
          "record_calls": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Where the key user's Record switch starts in the Ready Dialer. null until first saved."
          },
          "version": {
            "type": "integer",
            "description": "A counter the Ready Dialer keeps; pass it back only when syncing with it."
          }
        },
        "required": [
          "record_calls",
          "version"
        ]
      },
      "SipTrunkDetails": {
        "type": "object",
        "properties": {
          "sbc_ip": {
            "type": "string",
            "description": "Your SBC's public IPv4 address."
          },
          "sbc_port": {
            "type": "integer",
            "description": "Your SBC's SIP port."
          },
          "codecs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The codecs chosen."
          },
          "channel_limit": {
            "type": "integer",
            "description": "Concurrent calls allowed; starts at 10 and rises on its own when calls get close to it."
          },
          "created_at": {
            "type": "string"
          },
          "numbers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "phone_number": {
                  "type": "string",
                  "description": "E.164."
                }
              },
              "required": [
                "id",
                "phone_number"
              ]
            },
            "description": "The numbers that ring the trunk."
          }
        },
        "required": [
          "sbc_ip",
          "sbc_port",
          "codecs",
          "channel_limit",
          "numbers"
        ]
      },
      "SipTrunk": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean",
            "description": "Whether SIP trunking is on for the account. When false, nothing else is sent."
          },
          "host": {
            "type": "string",
            "description": "Ready's SIP host."
          },
          "allow_ips": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The addresses your SBC should allow. They can change, so read them here."
          },
          "codec_choices": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The codecs you can pick: PCMU, PCMA, G729."
          },
          "trunk": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SipTrunkDetails"
              },
              {
                "type": "null"
              }
            ],
            "description": "null until the trunk is turned on."
          }
        },
        "required": [
          "available"
        ]
      },
      "ApiKey": {
        "type": "object",
        "description": "A live API key without its secret.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The key id. Use it to delete the key."
          },
          "name": {
            "type": "string",
            "description": "Your label for the key."
          },
          "key_prefix": {
            "type": "string",
            "description": "The first characters of the key."
          },
          "last4": {
            "type": "string",
            "description": "The last four characters of the key. Empty string when unknown."
          },
          "kind": {
            "type": "string",
            "description": "mcp for a key made when you connected an AI app, otherwise live. In the cross sub-account list it can also be test."
          },
          "created_at": {
            "type": "string",
            "description": "When the key was made, ISO 8601.",
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the key was last used, ISO 8601. null until it is used; can lag by up to about an hour. Absent on the create response."
          }
        },
        "required": [
          "id",
          "name",
          "key_prefix",
          "last4",
          "kind"
        ]
      },
      "ApiKeyCreated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ApiKey"
          },
          {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "description": "The full key, starting rsms_. Returned only here; it cannot be shown again."
              }
            },
            "required": [
              "key"
            ]
          }
        ]
      },
      "ApiKeyOrganizationEntry": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ApiKey"
          },
          {
            "type": "object",
            "properties": {
              "sub_account_id": {
                "type": "integer",
                "description": "The account the key belongs to."
              },
              "sub_account_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "That account name."
              },
              "main": {
                "type": "boolean",
                "description": "true for a key of the agency (main) account."
              }
            },
            "required": [
              "sub_account_id",
              "main"
            ]
          }
        ]
      },
      "ApiFailureKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Key id."
          },
          "name": {
            "type": "string",
            "description": "Key name."
          },
          "prefix": {
            "type": "string",
            "description": "Key prefix."
          },
          "last4": {
            "type": "string",
            "description": "Last four characters."
          },
          "kind": {
            "type": "string",
            "description": "live, test or mcp."
          },
          "revoked": {
            "type": "boolean",
            "description": "Whether the key has been revoked."
          }
        },
        "required": [
          "id",
          "kind",
          "revoked"
        ]
      },
      "ApiFailure": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Row id. Send the last one as before to get the next page."
          },
          "created_at": {
            "type": "string",
            "description": "When the request was answered, ISO 8601."
          },
          "method": {
            "type": "string",
            "description": "HTTP method."
          },
          "path": {
            "type": "string",
            "description": "The route that was called."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status that was returned."
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "The error code that was stored. key_revoked for a revoked key 401."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "The error sentence, with phone numbers, emails and tokens taken out, cut at 300 characters."
          },
          "response": {
            "type": "object",
            "description": "The body the caller was shown, rebuilt from the stored row. Match on error_code.",
            "properties": {
              "success": {
                "type": "boolean",
                "description": "Always false."
              },
              "error": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The error sentence."
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The code the caller got (INVALID_API_KEY on a key_revoked row)."
              },
              "code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Repeats error_code."
              }
            }
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The request id."
          },
          "key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiFailureKey"
              },
              {
                "type": "null"
              }
            ],
            "description": "The key that made the request, or null when it is no longer known."
          },
          "account_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The account the request ran as."
          },
          "account_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "That account company name or email."
          }
        },
        "required": [
          "id",
          "created_at",
          "method",
          "path",
          "status"
        ]
      },
      "AccountBalance": {
        "type": "object",
        "description": "Balance of the wallet this account spends and its per text prices.",
        "properties": {
          "balance_usd": {
            "type": [
              "number",
              "null"
            ],
            "description": "Balance in dollars, rounded to cents. Use balance_cents for exact math. null when an agency pays for the account."
          },
          "balance_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Balance in cents. null when an agency pays for the account."
          },
          "plan": {
            "type": [
              "string",
              "null"
            ],
            "description": "Always null. Kept for older integrations; deprecated."
          },
          "sms_rate_usd_per_segment": {
            "type": [
              "number",
              "null"
            ],
            "description": "Your per segment rate, in dollars. null if it could not be read."
          },
          "carrier_fee_usd_per_segment": {
            "type": [
              "number",
              "null"
            ],
            "description": "The carrier fee per segment, in dollars. Only the sum with sms_rate_usd_per_segment is the contract."
          },
          "compliance_usd_per_segment": {
            "type": [
              "number",
              "null"
            ],
            "description": "The compliance surcharge per segment, in dollars, for validation and TCPA scrubbing when on. 0 when off."
          },
          "mms_usd_per_message": {
            "type": [
              "number",
              "null"
            ],
            "description": "Price of one text with an image, carrier fee included, in dollars."
          },
          "managed_billing_hidden": {
            "type": "boolean",
            "description": "Only present, as true, when an agency pays for this account. Every other field is then null."
          }
        },
        "required": [
          "balance_usd",
          "balance_cents",
          "plan",
          "sms_rate_usd_per_segment",
          "carrier_fee_usd_per_segment",
          "compliance_usd_per_segment",
          "mms_usd_per_message"
        ]
      },
      "ReplySortingGuide": {
        "type": "object",
        "properties": {
          "guide": {
            "type": "string",
            "description": "The guide text. Empty string when none is saved."
          }
        },
        "required": [
          "guide"
        ]
      },
      "ReplySortingCorrectionResult": {
        "type": "object",
        "properties": {
          "sorted_as": {
            "type": "string",
            "description": "How the sorter had read the reply: positive, negative or other. A reply the sorter never read shows as other."
          },
          "sorted": {
            "type": "boolean",
            "description": "true when the sorter actually read the reply; false means sorted_as other was only a default."
          }
        },
        "required": [
          "sorted_as",
          "sorted"
        ]
      },
      "WebhookSettings": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your endpoint. A key without manage_integrations sees only its origin (https://host)."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Subscribed event names."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether delivery is on. Always false when there is no URL."
          },
          "include_sub_accounts": {
            "type": "boolean",
            "description": "Whether this webhook also gets sub-account events."
          },
          "unknown_events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names in events that Ready never sends. Usually empty; save the events you want to clear them."
          }
        },
        "required": [
          "url",
          "events",
          "enabled",
          "include_sub_accounts",
          "unknown_events"
        ]
      },
      "WebhookSaveResult": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "The saved URL, normalized."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The saved events."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether delivery is on."
          },
          "include_sub_accounts": {
            "type": "boolean",
            "description": "Whether sub-account events are included."
          },
          "secret": {
            "type": "string",
            "description": "The signing secret (whsec_...). Only present when this save created or rotated it."
          }
        },
        "required": [
          "url",
          "events",
          "enabled",
          "include_sub_accounts"
        ]
      },
      "WebhookTestResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "true when your endpoint answered 2xx."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status your endpoint returned."
          },
          "paused": {
            "type": "boolean",
            "description": "Only present, as true, when the webhook is switched off. It still takes a test but gets no live events."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Only present when event was sent: the event names that were sent."
          }
        },
        "required": [
          "success",
          "status"
        ]
      },
      "SubAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The sub-account id. Send it as X-Sub-Account-Id."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "The sub-account owner email. null for a workspace you run yourself. For a GoHighLevel location sub-account it is a login key, not a mailbox."
          },
          "first_name": {
            "type": "string",
            "description": "Owner first name, \"\" when none."
          },
          "last_name": {
            "type": "string",
            "description": "Owner last name, \"\" when none."
          },
          "company_name": {
            "type": "string",
            "description": "Business name, \"\" when none."
          },
          "status": {
            "type": "string",
            "description": "active or suspended today. Treat an unknown value as not active."
          },
          "markup_usd_per_segment": {
            "type": [
              "number",
              "null"
            ],
            "description": "Legacy per segment markup, in dollars, or null."
          },
          "created_at": {
            "type": "string",
            "description": "When it was made, ISO 8601."
          },
          "billing": {
            "type": "string",
            "description": "Who pays: client or agency."
          },
          "account_kind": {
            "type": "string",
            "description": "client for a sub-account with an owner, workspace for one you run yourself."
          },
          "kind": {
            "type": "string",
            "description": "Older name for account_kind, same value."
          },
          "shares_owner_capacity": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether it texts under your registration. null for a sub-account that pays for itself and has not been opted in."
          },
          "shared_daily_limit": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Texts a day it may send under your registration. null means no limit of its own."
          }
        },
        "required": [
          "id",
          "company_name",
          "status",
          "billing",
          "account_kind",
          "kind",
          "shares_owner_capacity",
          "shared_daily_limit"
        ]
      },
      "SubAccountGhlLocation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The GoHighLevel location id."
          },
          "linked": {
            "type": "boolean",
            "description": "Whether the location was linked to the new sub-account."
          },
          "error_code": {
            "type": "string",
            "description": "When linked is false: why."
          },
          "error": {
            "type": "string",
            "description": "When linked is false: a sentence."
          },
          "test": {
            "type": "boolean",
            "description": "Present, as true, for a test key call."
          }
        },
        "required": [
          "id",
          "linked"
        ]
      },
      "SubAccountCreateResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The new sub-account id. null on a test key call."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "The owner email, lower cased. null for a workspace."
          },
          "company_name": {
            "type": "string",
            "description": "Business name."
          },
          "account_kind": {
            "type": "string",
            "description": "client or workspace."
          },
          "billing": {
            "type": "string",
            "description": "client or agency. Only on a create with an owner email."
          },
          "client_rate": {
            "type": "null",
            "description": "Always null: a new sub-account starts at Ready price. Only on a create with an owner email."
          },
          "invite_link": {
            "type": "string",
            "description": "The sign in link to send yourself. Only on a create with an owner email."
          },
          "invite_email_sent": {
            "type": "boolean",
            "description": "false means the invite email did not go out. Absent when send_invite was false."
          },
          "ownerless": {
            "type": "boolean",
            "description": "true for a workspace made without an email."
          },
          "ghl_location": {
            "$ref": "#/components/schemas/SubAccountGhlLocation"
          },
          "test": {
            "type": "boolean",
            "description": "Present, as true, for a test key call; nothing was created."
          }
        },
        "required": [
          "company_name",
          "account_kind"
        ]
      },
      "SubAccountRateResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Only on a test key call."
          },
          "test": {
            "type": "boolean",
            "description": "Only on a test key call."
          },
          "markup": {
            "type": "number",
            "description": "The saved per segment markup, in dollars."
          },
          "is_custom": {
            "type": "boolean",
            "description": "Whether the account has its own markup rather than your default."
          },
          "base_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Your rate, in dollars."
          },
          "client_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "What the client pays per segment, in dollars. null means Ready standard price."
          },
          "dialer_markup": {
            "type": "number",
            "description": "The saved call markup, in dollars per minute."
          }
        }
      },
      "TeamMember": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Their user id."
          },
          "email": {
            "type": "string",
            "description": "Login email."
          },
          "first_name": {
            "type": "string",
            "description": "First name, \"\" when none."
          },
          "last_name": {
            "type": "string",
            "description": "Last name, \"\" when none."
          },
          "role": {
            "type": "string",
            "description": "admin, member, manager, agent or viewer."
          },
          "status": {
            "type": "string",
            "description": "Account status."
          },
          "invite_status": {
            "type": "string",
            "description": "pending until they first sign in, then active."
          },
          "invite_expired": {
            "type": "boolean",
            "description": "Whether the pending invite link has expired."
          },
          "sub_account_access": {
            "type": "string",
            "description": "all or organization_only."
          },
          "holds_dialer_seat": {
            "type": "boolean",
            "description": "Whether they hold a dialer seat."
          },
          "created_at": {
            "type": "string",
            "description": "When they were added, ISO 8601."
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "invite_expired",
          "holds_dialer_seat"
        ]
      },
      "TeamMemberCreateResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Their user id. null on a test key call."
          },
          "email": {
            "type": "string",
            "description": "Their email, lower cased."
          },
          "role": {
            "type": "string",
            "description": "Only on a test key call: the role that would be given."
          },
          "company_name": {
            "type": "string",
            "description": "Company name, when one was set."
          },
          "ownerless": {
            "type": "boolean",
            "description": "Always false for a team member."
          },
          "invite_email_sent": {
            "type": "boolean",
            "description": "false means they were added but the invite email did not go out; call resend."
          },
          "test": {
            "type": "boolean",
            "description": "Present, as true, for a test key call; nothing was created."
          }
        },
        "required": [
          "email"
        ]
      },
      "TeamMemberRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The team member id."
          },
          "test": {
            "type": "boolean",
            "description": "Present, as true, for a test key call."
          }
        },
        "required": [
          "id"
        ]
      },
      "TeamMemberInviteResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The team member id."
          },
          "email": {
            "type": "string",
            "description": "Where the invite went."
          },
          "expires_at": {
            "type": "string",
            "description": "When the new link stops working, ISO 8601."
          },
          "test": {
            "type": "boolean",
            "description": "Present, as true, for a test key call; nothing was sent."
          }
        },
        "required": [
          "id"
        ]
      },
      "WhiteLabelDnsRecord": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "CNAME, A or TXT."
          },
          "name": {
            "type": "string",
            "description": "Record name."
          },
          "value": {
            "type": "string",
            "description": "Record value."
          }
        },
        "required": [
          "type",
          "name",
          "value"
        ]
      },
      "WhiteLabelBrand": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The brand name your sub-accounts see."
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Logo URL."
          },
          "primary_color": {
            "type": [
              "string",
              "null"
            ],
            "description": "Main color, for example #1a73e8."
          },
          "support_email": {
            "type": [
              "string",
              "null"
            ],
            "description": "The help email your sub-accounts are told to write to."
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom sign in domain."
          },
          "domain_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "none, pending, active or failed (still pending after 72 hours; check again to reopen)."
          },
          "white_label_enabled": {
            "type": "boolean",
            "description": "Whether white label is live."
          },
          "dns_records": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/WhiteLabelDnsRecord"
            },
            "description": "DNS records still to add, or null."
          }
        }
      },
      "WhiteLabelDomain": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "The saved domain."
          },
          "domain_status": {
            "type": "string",
            "description": "pending, active or failed."
          },
          "dns_records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WhiteLabelDnsRecord"
            },
            "description": "Records to add: a CNAME for a subdomain or A records for an apex, plus a TXT when ownership must be proven."
          },
          "waiting": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only on a check: what is still missing."
          }
        },
        "required": [
          "domain",
          "domain_status"
        ]
      },
      "WhiteLabelWaitingSignup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The account id."
          },
          "name": {
            "type": "string",
            "description": "Their name."
          },
          "email": {
            "type": "string",
            "description": "Their email."
          },
          "company_name": {
            "type": "string",
            "description": "Company name."
          },
          "signed_up_at": {
            "type": "string",
            "description": "When they signed up."
          }
        },
        "required": [
          "id"
        ]
      },
      "WhiteLabelJoinLink": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The private sign up link. null when the link is off."
          },
          "daily_cap": {
            "type": "integer",
            "description": "Daily sign up limit through the link."
          },
          "waiting": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WhiteLabelWaitingSignup"
            },
            "description": "Only on GET: sign ups waiting for your answer, newest 100."
          }
        },
        "required": [
          "url"
        ]
      },
      "SnapshotCounts": {
        "type": "object",
        "description": "How many items of each kind the snapshot holds.",
        "properties": {
          "automations": {
            "type": "integer"
          },
          "templates": {
            "type": "integer"
          },
          "drips": {
            "type": "integer"
          },
          "campaigns": {
            "type": "integer"
          },
          "pipelines": {
            "type": "integer"
          }
        }
      },
      "Snapshot": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The share key. Send it to POST /v1/snapshots/apply."
          },
          "label": {
            "type": "string",
            "description": "Its name."
          },
          "url": {
            "type": "string",
            "description": "The share link."
          },
          "apply_count": {
            "type": "integer",
            "description": "How many times it was applied and added something. Not a count of distinct accounts."
          },
          "created_at": {
            "type": "string",
            "description": "When it was made, ISO 8601."
          },
          "counts": {
            "$ref": "#/components/schemas/SnapshotCounts"
          }
        },
        "required": [
          "key",
          "label",
          "url",
          "apply_count",
          "created_at",
          "counts"
        ]
      },
      "SnapshotCreated": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The new share key."
          },
          "label": {
            "type": "string",
            "description": "Its name."
          },
          "url": {
            "type": "string",
            "description": "The share link."
          },
          "counts": {
            "$ref": "#/components/schemas/SnapshotCounts"
          },
          "left_out": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Only present when more than 500 of a kind were picked: how many of each kind were left out."
          }
        },
        "required": [
          "key",
          "label",
          "url",
          "counts"
        ]
      },
      "SnapshotAppliedItem": {
        "type": "object",
        "description": "One thing the install added. Carries more fields such as its id and name.",
        "properties": {
          "kind": {
            "type": "string",
            "description": "campaign, template, sequence (a drip campaign), list, custom_field or automation."
          },
          "needs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "node_id": {
                  "type": "string"
                },
                "step_type": {
                  "type": "string"
                },
                "needs": {
                  "type": "string",
                  "description": "A sentence for people; may be reworded."
                },
                "key": {
                  "type": "string",
                  "description": "The cleared setting, such as url, target or channel_id."
                }
              }
            },
            "description": "Automations only: settings cleared on install that you must enter again."
          }
        },
        "required": [
          "kind"
        ]
      },
      "SnapshotApplyResult": {
        "type": "object",
        "description": "Counts of what was added. Running it again adds nothing.",
        "properties": {
          "automations_created": {
            "type": "integer"
          },
          "templates_created": {
            "type": "integer"
          },
          "drips_created": {
            "type": "integer"
          },
          "campaigns_created": {
            "type": "integer"
          },
          "pipelines_created": {
            "type": "integer"
          },
          "stages_added": {
            "type": "integer"
          },
          "lists_created": {
            "type": "integer"
          },
          "custom_fields_created": {
            "type": "integer"
          },
          "automations_repaired": {
            "type": "integer",
            "description": "Only when the snapshot holds automations."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnapshotAppliedItem"
            },
            "description": "Each thing added."
          },
          "refused": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kinds our content checks turned away: campaign, template, drip."
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of whoever shared the snapshot."
          }
        },
        "required": [
          "items"
        ]
      },
      "PartnerFeeInput": {
        "type": "object",
        "description": "Fees in dollars, each what the client pays. Send at least one. Each must sit between the lowest and the ceiling.",
        "properties": {
          "sms": {
            "type": "number",
            "description": "Each SMS segment, without carrier fees. In dollars.",
            "minimum": 0
          },
          "mms": {
            "type": "number",
            "description": "Each MMS message. In dollars.",
            "minimum": 0
          },
          "scrub": {
            "type": "number",
            "description": "TCPA scrub, per segment. In dollars.",
            "minimum": 0
          },
          "validator": {
            "type": "number",
            "description": "Number validation, per segment. In dollars.",
            "minimum": 0
          },
          "number": {
            "type": "number",
            "description": "Each phone number, a month. In dollars.",
            "minimum": 0
          },
          "brand": {
            "type": "number",
            "description": "The brand registration, a month. In dollars.",
            "minimum": 0
          },
          "campaign": {
            "type": "number",
            "description": "Each campaign registration, a month. In dollars.",
            "minimum": 0
          },
          "blue": {
            "type": "number",
            "description": "An iMessage line, a month. In dollars.",
            "minimum": 0
          },
          "bluetext": {
            "type": "number",
            "description": "Each iMessage text, per segment. In dollars.",
            "minimum": 0
          },
          "localp": {
            "type": "number",
            "description": "Local presence, per segment. In dollars.",
            "minimum": 0
          },
          "vetting_standard": {
            "type": "number",
            "description": "Standard vetting, once per brand. Whole cents only. In dollars.",
            "minimum": 0
          },
          "vetting_enhanced": {
            "type": "number",
            "description": "Enhanced vetting, once per brand. Whole cents only. In dollars.",
            "minimum": 0
          },
          "priority_filing": {
            "type": "number",
            "description": "Priority filing, once per brand. Whole cents only. In dollars.",
            "minimum": 0
          },
          "facetime": {
            "type": "number",
            "description": "Each FaceTime audio minute. In dollars.",
            "minimum": 0
          },
          "ca_sms": {
            "type": "number",
            "description": "A text to Canada, per segment, on top of sms. In dollars.",
            "minimum": 0
          },
          "uk_sms": {
            "type": "number",
            "description": "A text to the UK, per segment, on top of sms. In dollars.",
            "minimum": 0
          },
          "au_sms": {
            "type": "number",
            "description": "A text to Australia, per segment, on top of sms. In dollars.",
            "minimum": 0
          },
          "uk_number": {
            "type": "number",
            "description": "A UK number, a month, on top of number. Whole cents only. In dollars.",
            "minimum": 0
          },
          "au_number": {
            "type": "number",
            "description": "An Australia number, a month, on top of number. Whole cents only. In dollars.",
            "minimum": 0
          },
          "whatsapp": {
            "type": "number",
            "description": "Each WhatsApp message (US and Canada marketing). Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_us_utility": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_uk_marketing": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_uk_utility": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_au_marketing": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_au_utility": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_mx_marketing": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_mx_utility": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_de_marketing": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_de_utility": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_pr_marketing": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "whatsapp_pr_utility": {
            "type": "number",
            "description": "Each WhatsApp message of this country and category. Not charged yet. In dollars.",
            "minimum": 0
          },
          "rcs": {
            "type": "number",
            "description": "Each RCS message. Not charged yet. In dollars.",
            "minimum": 0
          }
        }
      },
      "PartnerPendingFee": {
        "type": "object",
        "properties": {
          "product": {
            "type": "string",
            "description": "Product id."
          },
          "fee": {
            "type": "number",
            "description": "The fee, in dollars."
          },
          "effective_at": {
            "type": "string",
            "description": "When it starts. UTC text YYYY-MM-DD HH:MM:SS.ffffff with no zone, not ISO 8601."
          }
        },
        "required": [
          "product"
        ]
      },
      "PartnerClientFees": {
        "type": "object",
        "properties": {
          "ready": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            },
            "description": "Ready fee for this client. Keyed by product id, in dollars."
          },
          "lowest": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            },
            "description": "The lowest you can set. Keyed by product id, in dollars."
          },
          "ceiling": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            },
            "description": "The most you can set; null for a product Ready does not price. Keyed by product id, in dollars."
          },
          "billed": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            },
            "description": "What the client pays now. Keyed by product id, in dollars."
          },
          "pending": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerPendingFee"
            },
            "description": "Fee changes waiting to start."
          },
          "consent": {
            "type": "string",
            "description": "accepted, pending, declined or none. A fee above Ready needs accepted."
          },
          "can_edit": {
            "type": "boolean",
            "description": "Whether you can set this client fees."
          },
          "agency_markup": {
            "type": "boolean",
            "description": "Whether the client pays your agency markup."
          }
        }
      },
      "PartnerFeeChange": {
        "type": "object",
        "properties": {
          "product": {
            "type": "string",
            "description": "Product id."
          },
          "from": {
            "type": [
              "number",
              "null"
            ],
            "description": "Fee before, in dollars."
          },
          "to": {
            "type": [
              "number",
              "null"
            ],
            "description": "Fee after, in dollars."
          },
          "status": {
            "type": "string",
            "description": "now (billing now), scheduled (a raise, from effective_at), unchanged or canceled (a waiting raise taken back)."
          },
          "effective_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "UTC text YYYY-MM-DD HH:MM:SS.ffffff with no zone, not ISO 8601."
          }
        },
        "required": [
          "product",
          "status"
        ]
      },
      "PartnerDefaultFees": {
        "type": "object",
        "properties": {
          "defaults": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            },
            "description": "Your default fees. Keyed by product id, in dollars."
          },
          "standard": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            },
            "description": "Ready fee for a new sub-account. Keyed by product id, in dollars."
          },
          "lowest": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            },
            "description": "The lowest each default may be. Keyed by product id, in dollars."
          },
          "current_clients": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                }
              }
            },
            "description": "Your current clients you can apply new defaults to (apply_to_clients). null when the list could not be read."
          }
        }
      },
      "PartnerDefaultFeesSaveResult": {
        "type": "object",
        "properties": {
          "defaults": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            },
            "description": "Your saved defaults, in dollars. null if saved but not read back."
          },
          "applied": {
            "type": [
              "object",
              "null"
            ],
            "description": "Only when apply_to_clients was sent: counts of the per client outcomes. null otherwise."
          }
        },
        "required": [
          "defaults"
        ]
      },
      "PartnerConsentRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The request id."
          },
          "state": {
            "type": "string",
            "description": "Always pending."
          },
          "emailed": {
            "type": "boolean",
            "description": "Whether an email went out this time."
          },
          "next_email_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When no email went out because of the limit: the earliest time another can go, UTC text with no zone."
          }
        },
        "required": [
          "state",
          "emailed"
        ]
      },
      "PartnerInvite": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Invite id."
          },
          "email": {
            "type": "string",
            "description": "Where it went."
          },
          "business": {
            "type": "string",
            "description": "Business name."
          },
          "person": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name greeted."
          },
          "access": {
            "type": [
              "string",
              "null"
            ],
            "description": "account, agency or null."
          },
          "sent_at": {
            "type": "string",
            "description": "UTC time as text, YYYY-MM-DD HH:MM:SS with optional fraction, no zone, not ISO 8601."
          },
          "sends": {
            "type": "integer",
            "description": "How many times it was emailed."
          }
        },
        "required": [
          "id",
          "email"
        ]
      },
      "PartnerInviteList": {
        "type": "object",
        "properties": {
          "invites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerInvite"
            },
            "description": "Each address newest open invite, newest first."
          },
          "cut": {
            "type": "boolean",
            "description": "true when the list hit its 500 address limit."
          }
        },
        "required": [
          "invites",
          "cut"
        ]
      },
      "PartnerOverview": {
        "type": "object",
        "properties": {
          "partner": {
            "type": "object",
            "description": "You.",
            "properties": {
              "id": {
                "type": "integer"
              },
              "business": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "since": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The approval time as UTC text, not ISO 8601."
              },
              "share": {
                "type": "number",
                "description": "Your commission rate, as a fraction."
              }
            }
          },
          "carrier": {
            "type": "object",
            "description": "The carrier fees on every text. Nobody can change them."
          },
          "clients": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One client: id, business, email, joined_at, attribution fields, payer, share, fees, consent, access, setup and silent. setup keys are internal."
            },
            "description": "Your newest 1,000 clients."
          },
          "clients_cut": {
            "type": "boolean",
            "description": "true when older clients are left out."
          },
          "partners": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "id, business, name, clients, earned, yours."
            },
            "description": "Partners you recruited."
          },
          "daily": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "day, client_id, product, units, earn, spend, margin."
            },
            "description": "Daily totals, newest day first, up to 200,000 rows."
          },
          "ledger_from": {
            "type": [
              "string",
              "null"
            ],
            "description": "When daily was cut: the first day it covers. Else null."
          },
          "access_screens": {
            "description": "Read by the Partner page; no stable shape."
          },
          "products": {
            "description": "Read by the Partner page; no stable shape."
          },
          "white_label": {
            "description": "Read by the Partner page; no stable shape."
          }
        }
      },
      "PartnerClientsList": {
        "type": "object",
        "properties": {
          "agency": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "wallet_cents": {
                "type": "integer",
                "description": "Agency wallet in cents."
              },
              "managed": {
                "type": "boolean",
                "description": "true when you are another account independent sub-account."
              }
            }
          },
          "totals": {
            "type": "object",
            "description": "Totals. A search does not change them. When truncated is true they cover only the listed accounts, except wallet_spend_cents, which covers the whole wallet.",
            "properties": {
              "clients": {
                "type": "integer"
              },
              "needs_registration": {
                "type": "integer"
              },
              "sent": {
                "type": "integer"
              },
              "replies": {
                "type": "integer"
              },
              "unread": {
                "type": "integer"
              },
              "spend_cents": {
                "type": "integer",
                "description": "In cents."
              },
              "wallet_spend_cents": {
                "type": "integer",
                "description": "In cents."
              }
            }
          },
          "own": {
            "type": "object",
            "description": "Your own workspace as one row, in the client row shape with kind parent."
          },
          "clients": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One sub-account: id, name, email, ghl_location_id, ghl_location_ids, numbers, numbers_count, number, failed_today, registration (not_started, in_review, rejected or approved), sent, replies, unread, spend_cents, billing, created_at, created_via, archived, kind, payer, link, white_label_client, inherits, sends_on_agency_numbers, card_paused, awaiting_card, markup_pct. New columns can be added."
            },
            "description": "Newest first, up to a cap."
          },
          "truncated": {
            "type": "boolean",
            "description": "true when you manage more accounts than the list holds. The oldest accounts are then also missing from totals (wallet_spend_cents still covers the whole wallet)."
          },
          "search": {
            "type": "object",
            "description": "Only when q was sent: q as searched and matched, the number of rows kept."
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "An error. See https://docs.tryready.com/api/errors.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
