{
  "openapi": "3.0.1",
  "security": [
    {
      "accountSid_authToken": []
    }
  ],
  "components": {
    "securitySchemes": {
      "accountSid_authToken": {
        "scheme": "basic",
        "type": "http"
      }
    },
    "schemas": {
      "numbers.v3.hostedNumbers.hostedNumberOrder": {
        "type": "object",
        "properties": {
          "sid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^HR[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "A 34 character string that uniquely identifies this HostedNumberOrder."
          },
          "accountSid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^AC[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "A 34 character string that uniquely identifies the account."
          },
          "incomingPhoneNumberSid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^PN[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "A 34 character string that uniquely identifies the [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the phone number being hosted."
          },
          "addressSid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^AD[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number."
          },
          "signingDocumentSid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^PX[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "A 34 character string that uniquely identifies the [Authorization Document](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource) the user needs to sign."
          },
          "phoneNumber": {
            "type": "string",
            "format": "phone-number",
            "nullable": true,
            "description": "Phone number to be hosted. This must be in [E.164](https://en.wikipedia.org/wiki/E.164) format, e.g., +16175551212"
          },
          "capabilities": {
            "type": "object",
            "format": "phone-number-capabilities",
            "x-class-extra-annotation": "@JsonInclude(JsonInclude.Include.NON_NULL)",
            "properties": {
              "mms": {
                "type": "boolean"
              },
              "sms": {
                "type": "boolean"
              },
              "voice": {
                "type": "boolean"
              }
            },
            "nullable": true,
            "description": "Set of booleans describing the capabilities hosted on Twilio's platform. SMS is currently only supported."
          },
          "friendlyName": {
            "type": "string",
            "nullable": true,
            "description": "A 64 character string that is a human-readable text that describes this resource.",
            "x-twilio": {
              "pii": {
                "handling": "standard",
                "deleteSla": 30
              }
            }
          },
          "uniqueName": {
            "type": "string",
            "nullable": true,
            "description": "Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.",
            "x-twilio": {
              "pii": {
                "handling": "standard",
                "deleteSla": 30
              }
            }
          },
          "status": {
            "$ref": "#/components/schemas/hostedNumberOrderEnumStatus",
            "nullable": true,
            "description": "Status of this resource. It can hold one of the values: 1. Twilio Processing 2. Received, 3. Pending LOA, 4. Carrier Processing, 5. Completed, 6. Action Required, 7. Failed. See the [HostedNumberOrders Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values) section for more information on each of these statuses."
          },
          "failureReason": {
            "type": "string",
            "nullable": true,
            "description": "A message that explains why a hosted_number_order went to status \"action-required\""
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format."
          },
          "dateUpdated": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format."
          },
          "verificationAttempts": {
            "type": "integer",
            "default": 0,
            "description": "The number of attempts made to verify ownership of the phone number that is being hosted."
          },
          "email": {
            "type": "string",
            "nullable": true,
            "description": "Email of the owner of this phone number that is being hosted.",
            "x-twilio": {
              "pii": {
                "handling": "standard",
                "deleteSla": 30
              }
            }
          },
          "ccEmails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.",
            "x-twilio": {
              "pii": {
                "handling": "standard",
                "deleteSla": 30
              }
            }
          },
          "url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "The URL of this HostedNumberOrder."
          },
          "verificationType": {
            "$ref": "#/components/schemas/hostedNumberOrderEnumVerificationType",
            "nullable": true,
            "description": "The type of ownership verification required to move the number to a `verified` state. The verification methods are `phone-call` or `phone-bill`."
          },
          "verificationDocumentSid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^RI[0-9a-fA-F]{32}$",
            "nullable": true,
            "description": "A 34 character string that uniquely identifies the Identity Document resource that represents the document for verifying ownership of the number to be hosted."
          },
          "extension": {
            "type": "string",
            "nullable": true,
            "description": "A numerical extension to be used when making the ownership verification call."
          },
          "callDelay": {
            "type": "integer",
            "default": 0,
            "description": "A value between 0-30 specifying the number of seconds to delay initiating the ownership verification call."
          },
          "verificationCode": {
            "type": "string",
            "nullable": true,
            "description": "A verification code provided in the response for a user to enter when they pick up the phone call."
          },
          "verificationCallSids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "A list of 34 character strings that are unique identifiers for the calls placed as part of ownership verification."
          }
        }
      },
      "numbers.v3.hostedNumbers.createHostedNumberOrderRequest": {
        "type": "object",
        "title": "CreateHostedNumbersHostedNumberOrderRequest",
        "properties": {
          "phoneNumber": {
            "type": "string",
            "format": "phone-number",
            "description": "The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format"
          },
          "smsCapability": {
            "type": "boolean",
            "description": "Used to specify that the SMS capability will be hosted on Twilio's platform."
          },
          "accountSid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^AC[0-9a-fA-F]{32}$",
            "description": "This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to."
          },
          "friendlyName": {
            "type": "string",
            "description": "A 64 character string that is a human readable text that describes this resource."
          },
          "uniqueName": {
            "type": "string",
            "description": "Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID."
          },
          "ccEmails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to."
          },
          "smsUrl": {
            "type": "string",
            "format": "uri",
            "description": "The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource."
          },
          "smsMethod": {
            "type": "string",
            "format": "http-method",
            "enum": [
              "GET",
              "POST"
            ],
            "description": "The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`.  This will be copied onto the IncomingPhoneNumber resource."
          },
          "smsFallbackUrl": {
            "type": "string",
            "format": "uri",
            "description": "A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource."
          },
          "smsFallbackMethod": {
            "type": "string",
            "format": "http-method",
            "enum": [
              "GET",
              "POST"
            ],
            "description": "The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource."
          },
          "statusCallbackUrl": {
            "type": "string",
            "format": "uri",
            "description": "Optional. The Status Callback URL attached to the IncomingPhoneNumber resource."
          },
          "statusCallbackMethod": {
            "type": "string",
            "format": "http-method",
            "enum": [
              "GET",
              "POST"
            ],
            "description": "Optional. The Status Callback Method attached to the IncomingPhoneNumber resource."
          },
          "smsApplicationSid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^AP[0-9a-fA-F]{32}$",
            "description": "Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application."
          },
          "addressSid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^AD[0-9a-fA-F]{32}$",
            "description": "Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number."
          },
          "email": {
            "type": "string",
            "description": "Optional. Email of the owner of this phone number that is being hosted."
          },
          "verificationType": {
            "type": "string",
            "$ref": "#/components/schemas/hostedNumberOrderEnumVerificationType",
            "description": "Optional. The method used for verifying ownership of the number to be hosted. One of phone-call (default) or phone-bill."
          },
          "verificationDocumentSid": {
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^RI[0-9a-fA-F]{32}$",
            "description": "Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill."
          }
        },
        "required": [
          "phoneNumber",
          "smsCapability"
        ]
      },
      "hostedNumberOrderEnumStatus": {
        "type": "string",
        "enum": [
          "twilio-processing",
          "received",
          "pending-verification",
          "verified",
          "pending-loa",
          "carrier-processing",
          "testing",
          "completed",
          "failed",
          "action-required"
        ]
      },
      "hostedNumberOrderEnumVerificationType": {
        "type": "string",
        "enum": [
          "phone-call",
          "phone-bill"
        ]
      }
    }
  },
  "info": {
    "title": "Twilio - Numbers",
    "description": "This is the public Twilio REST API.",
    "termsOfService": "https://www.twilio.com/legal/tos",
    "contact": {
      "name": "Twilio Support",
      "url": "https://support.twilio.com",
      "email": "support@twilio.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.0",
    "x-twilio": {
      "apiStandards": "v1.0"
    }
  },
  "servers": [
    {
      "url": "https://numbers.twilio.com"
    }
  ],
  "paths": {
    "/v3/HostedNumbers/HostedNumberOrders": {
      "post": {
        "description": "Host a phone number's capability on Twilio's platform.",
        "tags": [
          "NumbersV3HostedNumbersHostedNumberOrder"
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/numbers.v3.hostedNumbers.hostedNumberOrder"
                },
                "examples": {
                  "create": {
                    "value": {
                      "accountSid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "addressSid": "AD11111111111111111111111111111111",
                      "callDelay": 0,
                      "capabilities": {
                        "sms": true,
                        "voice": false
                      },
                      "ccEmails": [],
                      "dateCreated": "2017-03-28T20:06:39Z",
                      "dateUpdated": "2017-03-28T20:06:39Z",
                      "email": "test@twilio.com",
                      "extension": null,
                      "failureReason": "",
                      "friendlyName": null,
                      "incomingPhoneNumberSid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "phoneNumber": "+14153608311",
                      "sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "signingDocumentSid": null,
                      "status": "received",
                      "uniqueName": null,
                      "url": "https://numbers.twilio.com/v3/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "verificationAttempts": 0,
                      "verificationCallSids": null,
                      "verificationCode": null,
                      "verificationDocumentSid": null,
                      "verificationType": "phone-call"
                    }
                  },
                  "createWithoutOptionalLoaFields": {
                    "value": {
                      "accountSid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "addressSid": null,
                      "callDelay": 0,
                      "capabilities": {
                        "sms": true,
                        "voice": false
                      },
                      "ccEmails": [],
                      "dateCreated": "2017-03-28T20:06:39Z",
                      "dateUpdated": "2017-03-28T20:06:39Z",
                      "email": null,
                      "extension": null,
                      "failureReason": "",
                      "friendlyName": null,
                      "incomingPhoneNumberSid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "phoneNumber": "+14153608311",
                      "sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "signingDocumentSid": null,
                      "status": "twilio-processing",
                      "uniqueName": null,
                      "url": "https://numbers.twilio.com/v3/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "verificationAttempts": 0,
                      "verificationCallSids": null,
                      "verificationCode": null,
                      "verificationDocumentSid": null,
                      "verificationType": "phone-call"
                    }
                  }
                }
              }
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "description": "Specify the origin(s) allowed to access the resource",
                "schema": {
                  "type": "string"
                },
                "example": "*"
              },
              "Access-Control-Allow-Methods": {
                "description": "Specify the HTTP methods allowed when accessing the resource",
                "schema": {
                  "type": "string"
                },
                "example": "POST, OPTIONS"
              },
              "Access-Control-Allow-Headers": {
                "description": "Specify the headers allowed when accessing the resource",
                "schema": {
                  "type": "string"
                },
                "example": "Content-Type, Authorization"
              },
              "Access-Control-Allow-Credentials": {
                "description": "Indicates whether the browser should include credentials",
                "schema": {
                  "type": "boolean"
                }
              },
              "Access-Control-Expose-Headers": {
                "description": "Headers exposed to the client",
                "schema": {
                  "type": "string",
                  "example": "X-Custom-Header1, X-Custom-Header2"
                }
              }
            },
            "description": "Created"
          }
        },
        "security": [
          {
            "accountSid_authToken": []
          }
        ],
        "operationId": "CreateHostedNumbersHostedNumberOrder",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/numbers.v3.hostedNumbers.createHostedNumberOrderRequest"
              },
              "examples": {
                "create": {
                  "value": {
                    "addressSid": "AD11111111111111111111111111111111",
                    "phoneNumber": "+14153608311",
                    "smsCapability": true,
                    "email": "test@twilio.com"
                  }
                },
                "createWithoutOptionalLoaFields": {
                  "value": {
                    "phoneNumber": "+14153608311",
                    "smsCapability": true
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}