Skip to content

Link an application to a phone number

PATCH
/v1/Accounts/{auth_id}/PhoneNumbers/{phone_number}
curl --request PATCH \
--url https://api.siprtc.io/v1/Accounts/AC000000000000000000/PhoneNumbers/%2B15555550100 \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "action": "number_app_association", "application_id": 1024, "modified_by": "jane@example.com" }'

Links an application to a number so that the application handles the number’s inbound calls and messages (action number_app_association), or unlinks it (action number_app_deassociation). The application must belong to the account the number is assigned to or to you; a parent account’s application with global scope may also be linked to a child’s number. Unlinking sets the application ID to -1 and ignores application_id. The number must be on your account (or, for a vendor, in its inventory) and have a subscription; it may be written with or without + and spaces.

auth_id
required
string

Your Auth ID.

Example

AC000000000000000000
phone_number
required
string

The number.

Example

+15555550100

Link or unlink action

Media type application/json
object
action
required

Number_app_association to link application_id, number_app_deassociation to unlink.

string
Allowed values: number_app_association number_app_deassociation

Example

number_app_association
application_id
required

ID of the application to link. It must belong to the number’s account or to you (or be a global application of the parent). Ignored when unlinking.

integer

Example

1024
modified_by

Optional name of the person making the change, recorded in the audit log.

string

Example

jane@example.com

Linked or unlinked: status success

Media type application/json
object
message

Human-readable result or error.

string
status

Success or failed.

string

Example

{
"message": "phone number not found",
"status": "failed"
}

Body not valid JSON, unknown action (Request action is not valid), or unlinking failed

Media type application/json
object
message

Human-readable result or error.

string
status

Success or failed.

string

Example

{
"message": "phone number not found",
"status": "failed"
}

Missing or invalid credentials (returned by the API gateway)

Media type application/json
string

Example generated

example

The application does not belong to the number’s account or to you

Media type application/json
object
message

Human-readable result or error.

string
status

Success or failed.

string

Example

{
"message": "phone number not found",
"status": "failed"
}

Number, subscription or application not found

Media type application/json
object
message

Human-readable result or error.

string
status

Success or failed.

string

Example

{
"message": "phone number not found",
"status": "failed"
}