1. Assistants
Flireo AI
  • Introducing Flireo AI
    • Introduction
    • Core concepts
    • Getting started
    • API overview
    • Errors
  • Assistants
    • Phone numbers linking
  • Phone numbers
    • Overview
    • Available numbers
    • List phone numbers
    • Order a phone number
    • Phone number orders
  • Verification groups
    • Overview
    • Available numbers
    • Create verification group
    • List verification groups
    • Order number via verification group
  • Server events
    • Assistant types
    • Assistant-request Event
    • Tool-calls Event
    • End-of-call-report Event
    • Status-update Event
    • Control live calls
API ReferenceDocumentatie
API ReferenceDocumentatie
Linkedin
  1. Assistants

Phone numbers linking

Link or unlink phone numbers from your assistants. When you link a phone number to an assistant, incoming calls to that number will be handled by that assistant.

Endpoints#

EndpointMethodDescription
/v1/assistants/{id}/phone-numberGETGet linked phone number
/v1/assistants/{id}/phone-numberPOSTLink a phone number
/v1/assistants/{id}/phone-numberDELETEUnlink phone number

Get Linked Phone Number#

Retrieve the phone number currently linked to an assistant.

Endpoint#

GET /v1/assistants/{id}/phone-number

Path Parameters#

ParameterTypeRequiredDescription
iduuidYesAssistant ID

Example Request#

Example Response#

{
  "data": {
    "assistant_id": "660e8400-e29b-41d4-a716-446655440000",
    "assistant_name": "Customer Support Agent",
    "phone_number": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "number": "+31201234567",
      "type": "local",
      "locality": "Amsterdam",
      "origin": "custom"
    }
  }
}

Response (No Phone Number Linked)#

{
  "data": {
    "assistant_id": "660e8400-e29b-41d4-a716-446655440000",
    "assistant_name": "Customer Support Agent",
    "phone_number": null
  }
}

Link Phone Number#

Link a phone number to an assistant. If the assistant already has a phone number, it will be automatically unlinked first.

Endpoint#

POST /v1/assistants/{id}/phone-number

Path Parameters#

ParameterTypeRequiredDescription
iduuidYesAssistant ID

Request Body#

FieldTypeRequiredDescription
phone_number_iduuidYesThe ID of the phone number to link

Example Request#

Example Response#

{
  "message": "Phone number linked successfully",
  "data": {
    "assistant_id": "660e8400-e29b-41d4-a716-446655440000",
    "phone_number": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "number": "+31201234567",
      "type": "local",
      "locality": "Amsterdam"
    },
    "previous_phone_number_id": null,
    "released_assistants": 0
  }
}
Note: When linking a shared (default) number, any other assistants using a default number will be automatically unlinked. The released_assistants field shows how many were affected.

Unlink Phone Number#

Remove the phone number from an assistant. The phone number becomes available again.

Endpoint#

DELETE /v1/assistants/{id}/phone-number

Path Parameters#

ParameterTypeRequiredDescription
iduuidYesAssistant ID

Example Request#

Example Response#

{
  "message": "Phone number unlinked successfully",
  "data": {
    "assistant_id": "660e8400-e29b-41d4-a716-446655440000",
    "unlinked_phone_number": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "number": "+31201234567"
    }
  }
}

Request JSON Schema (POST)#

{
  "type": "object",
  "properties": {
    "phone_number_id": {
      "type": "string",
      "format": "uuid",
      "description": "The ID of the phone number to link (from GET /v1/phone-numbers)"
    }
  },
  "required": ["phone_number_id"]
}

Response JSON Schema (GET)#

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "assistant_id": { "type": "string", "format": "uuid" },
        "assistant_name": { "type": "string" },
        "phone_number": {
          "type": "object",
          "nullable": true,
          "properties": {
            "id": { "type": "string", "format": "uuid" },
            "number": { "type": "string" },
            "type": { "type": "string", "enum": ["local", "mobile", "national"], "nullable": true },
            "locality": { "type": "string", "nullable": true },
            "origin": { "type": "string", "enum": ["default", "custom"] }
          }
        }
      }
    }
  }
}

Response JSON Schema (POST)#

{
  "type": "object",
  "properties": {
    "message": { "type": "string" },
    "data": {
      "type": "object",
      "properties": {
        "assistant_id": { "type": "string", "format": "uuid" },
        "phone_number": {
          "type": "object",
          "properties": {
            "id": { "type": "string", "format": "uuid" },
            "number": { "type": "string" },
            "type": { "type": "string", "nullable": true },
            "locality": { "type": "string", "nullable": true }
          }
        },
        "previous_phone_number_id": { "type": "string", "format": "uuid", "nullable": true },
        "released_assistants": { "type": "integer" }
      }
    }
  }
}

Response JSON Schema (DELETE)#

{
  "type": "object",
  "properties": {
    "message": { "type": "string" },
    "data": {
      "type": "object",
      "properties": {
        "assistant_id": { "type": "string", "format": "uuid" },
        "unlinked_phone_number": {
          "type": "object",
          "nullable": true,
          "properties": {
            "id": { "type": "string", "format": "uuid" },
            "number": { "type": "string" }
          }
        }
      }
    }
  }
}

Error Codes#

CodeHTTP StatusDescription
invalid_parameters400Invalid phone_number_id format
not_found404Assistant or phone number not found
forbidden403Phone number does not belong to you
already_linked400Phone number already linked to this assistant
already_in_use400Custom phone number is linked to another assistant
no_phone_number400No phone number to unlink

Next:
Learn about phone numbers or verification groups.
Modified at 2025-12-08 10:36:20
Previous
Errors
Next
Overview
Built with