{
 "openapi": "3.1.0",
 "info": {
  "title": "CoveSMS API",
  "version": "1.0.0",
  "termsOfService": "https://www.covesms.com/terms",
  "contact": {
   "name": "CoveSMS support",
   "url": "https://www.covesms.com/contact"
  },
  "description": "REST API to buy temporary virtual numbers and read SMS verification codes.\n\nA full purchase takes three calls:\n\n1. Read the price and the stock: GET /services?country=us (or GET /prices?service=whatsapp for one app in every country).\n\n2. Buy: POST /numbers with service and country. Add server to choose where the number comes from.\n\n3. Read the code: poll GET /numbers/{id} every 3 to 5 seconds, or set a webhook. No SMS in 20 minutes: the price goes back to your balance by itself.\n\nLoyalty program, only for the API: your level goes up with your weekly top-ups or with the codes you receive through the API, and gives 5% to 30% off every number. Prices returned by the API already include your discount. See your level in the dashboard (API loyalty) or in GET /account, under loyalty: level, discount_pct, valid_until, this week's topped_up and codes_received, and next_level with top_up_missing, codes_missing and progress_pct.\n\n120 requests per minute per key. Poll a number no faster than every 3 seconds.\n\nOne number per verification, SMS only, reserved 20 minutes.\n\nPrices move with supply: read them from /services or /prices, or send max_price.\n\nUp to 20 numbers per call with quantity. GET /account shows your limits.\n\nUse the API only for your own accounts, or as a reseller for customers who follow our Acceptable Use Policy. Bulk sign-ups, spam and getting around identity checks close the account.\n\nHuman docs: https://www.covesms.com/api/docs. One-file guide for AI agents: https://www.covesms.com/covesms-api.md. MCP server: https://www.covesms.com/mcp. Prices without a key: https://www.covesms.com/api/openapi-public.json."
 },
 "servers": [
  {
   "url": "https://www.covesms.com"
  }
 ],
 "security": [
  {
   "apiKey": []
  }
 ],
 "tags": [
  {
   "name": "Account"
  },
  {
   "name": "Catalog and prices"
  },
  {
   "name": "Buying"
  },
  {
   "name": "Your numbers"
  },
  {
   "name": "Email verification"
  },
  {
   "name": "eSIM (enabled accounts)"
  },
  {
   "name": "Public prices",
   "description": "No API key."
  }
 ],
 "paths": {
  "/api/v1/balance": {
   "get": {
    "operationId": "getBalance",
    "tags": [
     "Account"
    ],
    "summary": "Your balance and currency",
    "description": "Your balance and currency.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "balance": {
           "type": "number",
           "description": "In your account currency (field currency: USD, or BRL for accounts in Brazil)."
          },
          "currency": {
           "type": "string"
          },
          "status": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/account": {
   "get": {
    "operationId": "getAccount",
    "tags": [
     "Account"
    ],
    "summary": "Balance, your limits (requests per minute, numbers per day, open numbers), today's usage, what this key is allowed to buy and your loyalty progress (loyalty)",
    "description": "Balance, your limits (requests per minute, numbers per day, open numbers), today's usage, what this key is allowed to buy and your loyalty progress (loyalty).",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/countries": {
   "get": {
    "operationId": "listCountries",
    "tags": [
     "Catalog and prices"
    ],
    "summary": "Countries with numbers in stock, with the number of apps each",
    "description": "Countries with numbers in stock, with the number of apps each. Countries where one app is in stock, with price and stock per server.",
    "parameters": [
     {
      "name": "service",
      "in": "query",
      "required": false,
      "description": "App code, for example whatsapp, telegram, google. With it, the answer has price and stock per server for each country.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "countries": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": true
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/services": {
   "get": {
    "operationId": "listServices",
    "tags": [
     "Catalog and prices"
    ],
    "summary": "Apps in stock for one country: code, name, price, stock, and the price and stock of each server in servers[]",
    "description": "Apps in stock for one country: code, name, price, stock, and the price and stock of each server in servers[].",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": false,
      "description": "2-letter country code, lowercase: us, gb, br. Default us.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "country": {
           "type": "string"
          },
          "currency": {
           "type": "string"
          },
          "services": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "service": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "price": {
              "type": "number",
              "description": "Account currency, what a purchase without server pays"
             },
             "stock": {
              "type": "integer"
             },
             "servers": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "server": {
                 "type": "string",
                 "enum": [
                  "s1",
                  "s2",
                  "s3",
                  "s4",
                  "s5"
                 ]
                },
                "price": {
                 "type": "number",
                 "description": "In your account currency (field currency: USD, or BRL for accounts in Brazil)."
                },
                "stock": {
                 "type": "integer"
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/prices": {
   "get": {
    "operationId": "listPrices",
    "tags": [
     "Catalog and prices"
    ],
    "summary": "Flat price list, one line per app, country and server",
    "description": "Flat price list, one line per app, country and server. Send service, country or both; server is optional.",
    "parameters": [
     {
      "name": "service",
      "in": "query",
      "required": false,
      "description": "App code, for example whatsapp, telegram, google. Send service, country or both.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "country",
      "in": "query",
      "required": false,
      "description": "2-letter country code, lowercase: us, gb, br.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "server",
      "in": "query",
      "required": false,
      "description": "Only this server.",
      "schema": {
       "type": "string",
       "enum": [
        "s1",
        "s2",
        "s3",
        "s4",
        "s5"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "currency": {
           "type": "string"
          },
          "prices": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "service": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "country": {
              "type": "string"
             },
             "server": {
              "type": "string",
              "enum": [
               "s1",
               "s2",
               "s3",
               "s4",
               "s5"
              ]
             },
             "price": {
              "type": "number",
              "description": "In your account currency (field currency: USD, or BRL for accounts in Brazil)."
             },
             "stock": {
              "type": "integer"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/providers": {
   "get": {
    "operationId": "listProviders",
    "tags": [
     "Catalog and prices"
    ],
    "summary": "Server 4 and Server 5 only: the supply lines inside the server, each with its own price and stock",
    "description": "Server 4 and Server 5 only: the supply lines inside the server, each with its own price and stock. Use the id as provider when buying.",
    "parameters": [
     {
      "name": "service",
      "in": "query",
      "required": true,
      "description": "App code, for example whatsapp, telegram, google.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "country",
      "in": "query",
      "required": true,
      "description": "2-letter country code, lowercase: us, gb, br.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "server",
      "in": "query",
      "required": true,
      "description": "s4 or s5.",
      "schema": {
       "type": "string",
       "enum": [
        "s1",
        "s2",
        "s3",
        "s4",
        "s5"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "providers": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "price": {
              "type": "number",
              "description": "In your account currency (field currency: USD, or BRL for accounts in Brazil)."
             },
             "stock": {
              "type": "integer"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/numbers": {
   "post": {
    "operationId": "buyNumber",
    "tags": [
     "Buying"
    ],
    "summary": "Buy one number, or several with quantity",
    "description": "Buy one number, or several with quantity. Body: service, country, and the options below. Returns 201.",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 100
      },
      "description": "Send a unique value on every purchase. Repeating the request with the same key within 24 hours returns the first answer and buys nothing twice."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Purchase"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "$ref": "#/components/schemas/Number"
          },
          {
           "type": "object",
           "description": "Answer when quantity is sent.",
           "properties": {
            "requested": {
             "type": "integer"
            },
            "bought": {
             "type": "integer"
            },
            "data": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/Number"
             }
            },
            "errors": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "code": {
                "type": "string"
               },
               "message": {
                "type": "string"
               }
              }
             }
            }
           }
          }
         ]
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "operationId": "listNumbers",
    "tags": [
     "Your numbers"
    ],
    "summary": "Numbers bought through the API, newest first",
    "description": "Numbers bought through the API, newest first. Filters: status (active, waiting, received, canceled, expired, all), service, country, number (area code or any digits of the phone number, e.g. number=11). Paginate with before=<created_at>.",
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "required": false,
      "description": "Default active.",
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "waiting",
        "received",
        "canceled",
        "expired",
        "all"
       ]
      }
     },
     {
      "name": "service",
      "in": "query",
      "required": false,
      "description": "App code, for example whatsapp, telegram, google.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "country",
      "in": "query",
      "required": false,
      "description": "2-letter country code, lowercase: us, gb, br.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "1 to 100. Default 50.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100
      }
     },
     {
      "name": "number",
      "in": "query",
      "required": false,
      "description": "Digits of the phone number, anywhere in it: an area code (11) or any part (192). Only your numbers that contain them.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "before",
      "in": "query",
      "required": false,
      "description": "created_at of the last item of the previous page.",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Number"
           }
          },
          "has_more": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/numbers/{id}/rebuy": {
   "get": {
    "operationId": "getRebuyPrice",
    "tags": [
     "Buying"
    ],
    "summary": "Price to buy the same number again (Server 1 and Server 3, after the number is finished)",
    "description": "Price to buy the same number again (Server 1 and Server 3, after the number is finished).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The number id.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string"
          },
          "phone": {
           "type": "string"
          },
          "price": {
           "type": "number",
           "description": "In your account currency (field currency: USD, or BRL for accounts in Brazil)."
          },
          "currency": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "rebuyNumber",
    "tags": [
     "Buying"
    ],
    "summary": "Buy the same number again",
    "description": "Buy the same number again. Optional body: max_price. Returns a new number object.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The number id.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 100
      },
      "description": "Send a unique value on every purchase. Repeating the request with the same key within 24 hours returns the first answer and buys nothing twice."
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "max_price": {
          "type": "number",
          "description": "Highest price accepted, in your account currency."
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Number"
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/numbers/{id}": {
   "get": {
    "operationId": "getNumber",
    "tags": [
     "Your numbers"
    ],
    "summary": "One number's status and every SMS it received",
    "description": "One number's status and every SMS it received. Poll every 3 to 5 seconds, or use the webhook.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The number id.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Number"
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/numbers/{id}/cancel": {
   "post": {
    "operationId": "cancelNumber",
    "tags": [
     "Your numbers"
    ],
    "summary": "Cancel a number with no SMS and get its price back to your balance",
    "description": "Cancel a number with no SMS and get its price back to your balance. Allowed from cancelable_at (2 minutes after purchase).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The number id.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Number"
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/numbers/cancel": {
   "post": {
    "operationId": "cancelNumbers",
    "tags": [
     "Your numbers"
    ],
    "summary": "Cancel up to 50 numbers in one call",
    "description": "Cancel up to 50 numbers in one call. Body: ids. Each id answers with the number or with its error.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "ids"
        ],
        "properties": {
         "ids": {
          "type": "array",
          "minItems": 1,
          "maxItems": 50,
          "items": {
           "type": "string",
           "format": "uuid"
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "additionalProperties": true
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/numbers/{id}/resend": {
   "post": {
    "operationId": "resendSms",
    "tags": [
     "Your numbers"
    ],
    "summary": "Ask for another SMS on an open number that already got one",
    "description": "Ask for another SMS on an open number that already got one. Free.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The number id.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Number"
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/numbers/{id}/finish": {
   "post": {
    "operationId": "finishNumber",
    "tags": [
     "Your numbers"
    ],
    "summary": "Release a number that got its code, before the reservation ends",
    "description": "Release a number that got its code, before the reservation ends.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The number id.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Number"
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/emails": {
   "get": {
    "operationId": "listEmails",
    "tags": [
     "Email verification"
    ],
    "summary": "Email addresses for verification (Server 1 and Server 5): app, server, domain, price and stock",
    "description": "Email addresses for verification (Server 1 and Server 5): app, server, domain, price and stock.",
    "parameters": [
     {
      "name": "service",
      "in": "query",
      "required": false,
      "description": "App code, for example whatsapp, telegram, google.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "currency": {
           "type": "string"
          },
          "emails": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "service": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "server": {
              "type": "string",
              "enum": [
               "s1",
               "s2",
               "s3",
               "s4",
               "s5"
              ]
             },
             "domain": {
              "type": "string"
             },
             "price": {
              "type": "number",
              "description": "In your account currency (field currency: USD, or BRL for accounts in Brazil)."
             },
             "stock": {
              "type": "integer"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "buyEmail",
    "tags": [
     "Email verification"
    ],
    "summary": "Buy an email address",
    "description": "Buy an email address. Body: service, server, domain, optional max_price. The answer is a number object with type \"email\"; read the code with GET /numbers/{id}.",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 100
      },
      "description": "Send a unique value on every purchase. Repeating the request with the same key within 24 hours returns the first answer and buys nothing twice."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "service",
         "server",
         "domain"
        ],
        "properties": {
         "service": {
          "type": "string",
          "description": "App code, for example whatsapp, telegram, google."
         },
         "server": {
          "type": "string",
          "enum": [
           "s1",
           "s5"
          ]
         },
         "domain": {
          "type": "string",
          "description": "Domain from GET /emails."
         },
         "max_price": {
          "type": "number",
          "description": "Highest price accepted, in your account currency."
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Number"
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/esim": {
   "get": {
    "operationId": "listEsimPlans",
    "tags": [
     "eSIM (enabled accounts)"
    ],
    "summary": "eSIM plans (Vivo Controle, Brazil) with your price, the area codes in stock and preorders for other area codes",
    "description": "eSIM plans (Vivo Controle, Brazil) with your price, the area codes in stock and preorders for other area codes. Only works on accounts with eSIM enabled by support; others get not_allowed.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "currency": {
           "type": "string"
          },
          "plans": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string",
              "description": "Plan id, used in plan."
             },
             "name": {
              "type": "string"
             },
             "carrier": {
              "type": "string"
             },
             "data_gb": {
              "type": "integer"
             },
             "validity_days": {
              "type": "integer"
             },
             "description": {
              "type": "string"
             },
             "price": {
              "type": "number",
              "description": "In your account currency (field currency: USD, or BRL for accounts in Brazil)."
             },
             "stock": {
              "type": "integer"
             },
             "area_codes": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "area_code": {
                 "type": "string"
                },
                "city": {
                 "type": "string"
                },
                "state": {
                 "type": "string"
                },
                "stock": {
                 "type": "integer"
                }
               }
              }
             },
             "preorder": {
              "type": [
               "object",
               "null"
              ],
              "properties": {
               "price": {
                "type": "number",
                "description": "In your account currency (field currency: USD, or BRL for accounts in Brazil)."
               },
               "delivery_hours": {
                "type": "integer"
               },
               "max_per_request": {
                "type": "integer"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/esim/orders": {
   "post": {
    "operationId": "buyEsim",
    "tags": [
     "eSIM (enabled accounts)"
    ],
    "summary": "Buy 1 eSIM with an area code in stock",
    "description": "Buy 1 eSIM with an area code in stock. Body: plan, area_code, optional max_price. Send an Idempotency-Key. The answer has status delivered with esim.lpa (the QR code text), smdp_address and activation_code, or pending: check GET /esim/orders/{id}.",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 100
      },
      "description": "Send a unique value on every purchase. Repeating the request with the same key within 24 hours returns the first answer and buys nothing twice."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "plan",
         "area_code"
        ],
        "properties": {
         "plan": {
          "type": "string",
          "description": "Plan id from GET /esim."
         },
         "area_code": {
          "type": "string",
          "description": "2-digit Brazilian area code in stock (GET /esim)."
         },
         "max_price": {
          "type": "number",
          "description": "Highest price accepted, in your account currency."
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EsimOrder"
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "operationId": "listEsimOrders",
    "tags": [
     "eSIM (enabled accounts)"
    ],
    "summary": "Your eSIM orders, newest first (limit up to 100)",
    "description": "Your eSIM orders, newest first (limit up to 100).",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Up to 100. Default 50.",
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "orders": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/EsimOrder"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/esim/preorders": {
   "post": {
    "operationId": "preorderEsim",
    "tags": [
     "eSIM (enabled accounts)"
    ],
    "summary": "Preorder eSIMs with any area code in Brazil (one area code per eSIM, up to 10)",
    "description": "Preorder eSIMs with any area code in Brazil (one area code per eSIM, up to 10). Body: plan, area_codes, max_total. Delivered within 1 hour; if not, the price goes back to your balance by itself.",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 100
      },
      "description": "Send a unique value on every purchase. Repeating the request with the same key within 24 hours returns the first answer and buys nothing twice."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "plan",
         "area_codes",
         "max_total"
        ],
        "properties": {
         "plan": {
          "type": "string",
          "description": "Plan id from GET /esim."
         },
         "area_codes": {
          "type": "array",
          "maxItems": 10,
          "items": {
           "type": "string",
           "description": "2-digit Brazilian area code."
          }
         },
         "max_total": {
          "type": "number",
          "description": "Highest total accepted, in your account currency."
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "orders": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/EsimOrder"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/esim/orders/{id}": {
   "get": {
    "operationId": "getEsimOrder",
    "tags": [
     "eSIM (enabled accounts)"
    ],
    "summary": "One eSIM order",
    "description": "One eSIM order. status: pending, ordered, delivered, failed (price returned) or refunded.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "The eSIM order id.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EsimOrder"
        }
       }
      }
     },
     "400": {
      "description": "no_numbers, too_early, already_closed",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "invalid_api_key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "insufficient_balance",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "not_allowed, server_unavailable, api_paused, account_suspended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "price_above_max, queue_available, provider_sold_out, price_changed, rebuy_unavailable, request_in_progress",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "too_many_active, daily_limit, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "provider_unavailable",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/public/countries": {
   "get": {
    "operationId": "listPublicCountries",
    "tags": [
     "Public prices"
    ],
    "security": [],
    "summary": "Countries with numbers in stock",
    "description": "Countries where CoveSMS has virtual numbers in stock right now. No API key.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "countries": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "country": {
              "type": "string",
              "description": "2-letter code."
             },
             "name": {
              "type": "string"
             },
             "dial_code": {
              "type": "string"
             },
             "apps_in_stock": {
              "type": "integer"
             }
            }
           }
          },
          "how_to_buy": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/public/prices": {
   "get": {
    "operationId": "searchPublicPrices",
    "tags": [
     "Public prices"
    ],
    "security": [],
    "summary": "Live prices and stock for one country",
    "description": "Live price and stock of virtual numbers for SMS verification in one country. Send service to look up one app and currency=BRL for prices in reais (what an account in Brazil is charged). No API key. Cached for up to 10 minutes.",
    "parameters": [
     {
      "name": "country",
      "in": "query",
      "required": false,
      "description": "2-letter country code, lowercase: us, gb, br. Default us.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "service",
      "in": "query",
      "required": false,
      "description": "App code or part of the name, for example whatsapp.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "currency",
      "in": "query",
      "required": false,
      "description": "USD (default) or BRL. BRL = the price an account in Brazil is charged in reais.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "country": {
           "type": "string"
          },
          "currency": {
           "type": "string",
           "description": "USD or BRL, as asked."
          },
          "brl_per_usd": {
           "type": "number",
           "description": "Only with currency=BRL: the rate used."
          },
          "total_apps": {
           "type": "integer"
          },
          "services": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "service": {
              "type": "string",
              "description": "App code."
             },
             "name": {
              "type": "string"
             },
             "price": {
              "type": "number",
              "description": "Lowest price, in the currency asked (USD by default)."
             },
             "stock": {
              "type": "integer"
             },
             "servers": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "server": {
                 "type": "string",
                 "enum": [
                  "s1",
                  "s2",
                  "s3",
                  "s4",
                  "s5"
                 ]
                },
                "price": {
                 "type": "number",
                 "description": "In the currency asked."
                },
                "stock": {
                 "type": "integer"
                },
                "best_delivery": {
                 "type": "boolean",
                 "description": "Present when this server is delivering codes best for this app and country right now."
                }
               }
              }
             }
            }
           }
          },
          "note": {
           "type": "string"
          },
          "rules": {
           "type": "string"
          },
          "buy_url": {
           "type": "string",
           "description": "Where the person signs up and buys."
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid country",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "http",
    "scheme": "bearer",
    "description": "API key from Dashboard → API (starts with cove_live_). Also accepted in the X-API-Key header."
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string"
       },
       "message": {
        "type": "string"
       }
      },
      "additionalProperties": true
     }
    },
    "description": "Codes: invalid_api_key (Missing, wrong or revoked key); insufficient_balance (Balance too low; needed shows the price); price_above_max (Live price is above your max_price; price shows the live price); no_numbers (Out of stock; you weren't charged); queue_available (Server 4 or 5 has no number right now; you weren't charged. Try again or pick another server); provider_sold_out (The supply line you chose ran out; read /providers again); price_changed (The cheapest numbers ran out and the next ones cost more; you weren't charged. price shows the new price; send the request again); not_allowed (This key is limited to certain apps or servers; GET /account lists them); server_unavailable (Server 3 is not enabled for this account); too_many_active (Too many open numbers; finish or cancel one first); daily_limit (Daily number limit of this key reached; limit and used show the numbers); too_early (Cancel before cancelable_at; wait_seconds says how long); already_closed (Number already canceled, expired or finished); rebuy_unavailable (This number can't be bought again); request_in_progress (The same Idempotency-Key is still running; retry in a few seconds); api_paused (API access for this account is paused; contact support); account_suspended (Contact support); rate_limited (More than 120 requests in a minute); provider_unavailable (Temporary carrier issue; not charged. Retry shortly)."
   },
   "Purchase": {
    "type": "object",
    "required": [
     "service",
     "country"
    ],
    "description": "Only service and country are required. Without server, the number comes from the cheapest server in stock.",
    "properties": {
     "service": {
      "type": "string",
      "description": "App code from /services, for example whatsapp, telegram, google."
     },
     "country": {
      "type": "string",
      "description": "2-letter country code, lowercase: us, br, gb."
     },
     "max_price": {
      "type": "number",
      "description": "Highest price you accept, in your account currency (USD, or BRL for accounts in Brazil). If the live price is above it, nothing is bought (price_above_max)."
     },
     "server": {
      "type": "string",
      "enum": [
       "s1",
       "s2",
       "s3",
       "s4",
       "s5"
      ],
      "description": "s1, s2, s3, s4 or s5. The number comes only from that server, at that server's price."
     },
     "area_code": {
      "type": "string",
      "description": "Server 3 (Brazil numbers): 2-digit area code (DDD), for example 11. Adds 30% to the price."
     },
     "carrier": {
      "type": "string",
      "description": "Server 3 (Brazil numbers): claro, oi, tim or vivo."
     },
     "provider": {
      "type": "number",
      "description": "Server 4 and Server 5: id of one supply line from /providers. The number comes only from it, at its price."
     },
     "quantity": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20,
      "description": "1 to 20 numbers in one call. The answer changes to { requested, bought, data[], errors[] }."
     }
    }
   },
   "Number": {
    "type": "object",
    "description": "Every purchase and every number endpoint answers with the same object:",
    "properties": {
     "id": {
      "type": "string",
      "description": "Use it in the other endpoints.",
      "format": "uuid"
     },
     "phone": {
      "type": [
       "string",
       "null"
      ],
      "description": "The number, with country code. null for an email."
     },
     "type": {
      "type": "string",
      "enum": [
       "sms",
       "email"
      ]
     },
     "email": {
      "type": "string",
      "description": "Only for type email."
     },
     "domain": {
      "type": "string",
      "description": "Only for type email."
     },
     "service": {
      "type": "string"
     },
     "country": {
      "type": "string"
     },
     "server": {
      "type": [
       "string",
       "null"
      ]
     },
     "area_code": {
      "type": [
       "string",
       "null"
      ]
     },
     "carrier": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "waiting",
       "received",
       "finished",
       "canceled",
       "expired"
      ],
      "description": "waiting: Open for 20 minutes, waiting for an SMS. received: At least one SMS arrived. The code is in sms[].code, the full text in sms[].text. finished: You released the number after getting the code. canceled: You canceled it before any SMS. Price back to your balance. expired: No SMS within 20 minutes. Balance back automatically."
     },
     "price": {
      "type": "number",
      "description": "What was charged from the balance."
     },
     "currency": {
      "type": "string"
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "cancelable_at": {
      "type": "string",
      "format": "date-time"
     },
     "expires_at": {
      "type": "string",
      "format": "date-time"
     },
     "sms": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "code": {
         "type": [
          "string",
          "null"
         ]
        },
        "text": {
         "type": "string"
        },
        "received_at": {
         "type": "string",
         "format": "date-time"
        }
       }
      }
     }
    }
   },
   "EsimOrder": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "eSIM order id.",
      "format": "uuid"
     },
     "type": {
      "type": "string",
      "enum": [
       "purchase",
       "preorder"
      ]
     },
     "plan": {
      "type": "string"
     },
     "area_code": {
      "type": "string"
     },
     "city": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "pending",
       "ordered",
       "delivered",
       "failed",
       "refunded"
      ],
      "description": "pending: buying now. ordered: preorder waiting for delivery (deliver_by). delivered: esim is filled. failed: not delivered, price returned to the balance. refunded: refunded by support."
     },
     "price": {
      "type": "number",
      "description": "What was charged from the balance."
     },
     "currency": {
      "type": "string"
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "delivered_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "deliver_by": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "esim": {
      "type": [
       "object",
       "null"
      ],
      "description": "Only when delivered.",
      "properties": {
       "lpa": {
        "type": "string",
        "description": "Full activation string (LPA:1$...). Turn it into a QR code to install."
       },
       "smdp_address": {
        "type": "string",
        "description": "SM-DP+ address, for manual install."
       },
       "activation_code": {
        "type": "string",
        "description": "Activation code, for manual install."
       },
       "phone": {
        "type": [
         "string",
         "null"
        ]
       },
       "pin": {
        "type": [
         "string",
         "null"
        ]
       },
       "test_until": {
        "type": [
         "string",
         "null"
        ],
        "format": "date-time",
        "description": "Install and test before this time; problems after it can't be replaced."
       }
      }
     }
    }
   }
  }
 },
 "x-webhooks-note": "Set an HTTPS URL in Dashboard → API. When a number bought through the API receives an SMS, we POST an sms.received event, retrying up to 3 times. Reply with any 2xx. Every request carries X-Signature: t=<unix>,v1=<hex>, the HMAC-SHA256 of \"<t>.<raw body>\" with your signing secret. Reject timestamps older than 5 minutes."
}