openapi: 3.2.0 info: title: MessageBird Numbers Purchased Numbers API description: The MessageBird Numbers API enables developers to search for, purchase, and manage phone numbers programmatically. It supports local, toll-free, and mobile number types across multiple countries, with the ability to filter by pattern, type, and region. Purchased numbers can be configured for SMS and voice capabilities and assigned to specific messaging or calling workflows. version: '1.0' contact: name: MessageBird Support url: https://support.messagebird.com termsOfService: https://www.messagebird.com/en/terms servers: - url: https://numbers.messagebird.com/v1 description: Production Server security: - accessKey: [] tags: - name: Purchased Numbers description: Operations for managing purchased phone numbers. paths: /phone-numbers: get: operationId: listPurchasedNumbers summary: List purchased phone numbers description: Retrieves a paginated list of all phone numbers purchased on the account. tags: - Purchased Numbers parameters: - name: limit in: query required: false description: The maximum number of items to return. schema: type: integer default: 20 - name: offset in: query required: false description: The number of items to skip. schema: type: integer default: 0 responses: '200': description: A list of purchased numbers content: application/json: schema: $ref: '#/components/schemas/PurchasedNumberList' '401': description: Unauthorized post: operationId: purchaseNumber summary: Purchase a phone number description: Purchases an available phone number and adds it to the account. tags: - Purchased Numbers requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/NumberPurchase' responses: '201': description: Number purchased content: application/json: schema: $ref: '#/components/schemas/PurchasedNumber' '400': description: Bad request '401': description: Unauthorized '422': description: Unprocessable entity /phone-numbers/{number}: get: operationId: viewPurchasedNumber summary: View a purchased phone number description: Retrieves the details of a specific purchased phone number. tags: - Purchased Numbers parameters: - $ref: '#/components/parameters/numberParam' responses: '200': description: Number details content: application/json: schema: $ref: '#/components/schemas/PurchasedNumber' '401': description: Unauthorized '404': description: Number not found patch: operationId: updatePurchasedNumber summary: Update a purchased phone number description: Updates the configuration of a purchased phone number, such as assigning tags or enabling features. tags: - Purchased Numbers parameters: - $ref: '#/components/parameters/numberParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/NumberUpdate' responses: '200': description: Number updated content: application/json: schema: $ref: '#/components/schemas/PurchasedNumber' '400': description: Bad request '401': description: Unauthorized '404': description: Number not found delete: operationId: cancelPurchasedNumber summary: Cancel a purchased phone number description: Cancels a purchased phone number, releasing it from the account. tags: - Purchased Numbers parameters: - $ref: '#/components/parameters/numberParam' responses: '204': description: Number cancelled '401': description: Unauthorized '404': description: Number not found components: schemas: NumberUpdate: type: object properties: tags: type: array description: Tags to assign to the number. items: type: string PurchasedNumber: type: object properties: number: type: string description: The phone number in E.164 format. country: type: string description: The two-letter country code. region: type: string description: The region for the number. locality: type: string description: The locality for the number. features: type: array description: The features enabled for the number. items: type: string tags: type: array description: Tags assigned to the number. items: type: string type: type: string description: The type of phone number. status: type: string description: The status of the number. enum: - active - cancelled createdAt: type: string format: date-time description: The date and time when the number was purchased. renewalAt: type: string format: date-time description: The date and time of the next renewal. NumberPurchase: type: object required: - number - countryCode properties: number: type: string description: The phone number to purchase in E.164 format. countryCode: type: string description: The two-letter ISO 3166-1 country code. minLength: 2 maxLength: 2 billingIntervalMonths: type: integer description: The billing interval in months. enum: - 1 - 12 default: 1 PurchasedNumberList: type: object properties: items: type: array items: $ref: '#/components/schemas/PurchasedNumber' count: type: integer description: The number of items returned. totalCount: type: integer description: The total number of purchased numbers. offset: type: integer description: The offset applied. limit: type: integer description: The limit applied. parameters: numberParam: name: number in: path required: true description: The phone number in E.164 format. schema: type: string securitySchemes: accessKey: type: apiKey in: header name: Authorization description: Access key authentication in the form of 'AccessKey {accessKey}'. externalDocs: description: Numbers API Documentation url: https://developers.messagebird.com/api/numbers/