Skip to content
Phone Numbers

POSThttps://core-api.heysadie.ai/phone-numbers/import

sid success data id phoneNumber country monthlySubscriptionCost imported createdAt updatedAt assistantName metadata timestamp version path error code message details field

Import a Twilio number

Imports a number from your own connected Twilio account, by its SID from the import search. Imported numbers make outbound calls only: they can't be linked to an assistant, Oncore never changes them on Twilio, and removing one from Oncore leaves it on your Twilio account. Oncore does not bill for them; you pay Twilio directly. - 201 with the new phone number. Importing a number you already imported returns it with 200. - 400 `PHONE_NUMBER_NOT_VOICE_CAPABLE` when the number can't make voice calls. - 404 when the SID isn't a number on your Twilio account. - 409 `PHONE_NUMBER_IN_USE` when the number is already in use in Oncore. - 409 `TWILIO_NOT_CONNECTED` or `TWILIO_CREDENTIALS_REJECTED`: connect or reconnect Twilio in Integrations.

Try it in the API Explorer

Example request

Terminal
curl -X POST "https://core-api.heysadie.ai/phone-numbers/import" \
  -H "Authorization: ApiKey YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sid": "string"
  }'

Authentication

Authenticate with an API key in the Authorization header using the ApiKey scheme. See Authentication for how keys work and where to get them.

Authorizationstringrequired

API key in the ApiKey scheme: ApiKey YOUR_API_KEY. Tenant keys authorize their own tenant; organization keys can act on any tenant in the organization.

X-Tenant-Idstring (uuid)optional

Required when authenticating with an organization key: it selects the tenant the request acts on. Omit with tenant keys.

Request

Body application/json · required

sidstringrequired

Twilio phone number SID (PN…) from the import search

Responses

200Already imported: the existing number
successbooleanrequired

true on every 2xx

dataobjectoptional

The result

Show 8 child properties
idstringrequired
phoneNumberstringrequired
countrystringrequired
monthlySubscriptionCoststring | nullrequired
importedbooleanrequired

True for a number imported from your own Twilio account. Imported numbers make outbound calls only.

createdAtstring (date-time) | string (date) | number | nullrequired
updatedAtstring (date-time) | string (date) | number | nullrequired
assistantNamestring | nullrequired
metadataobjectoptional

Request metadata

Show 3 child properties
timestampstringrequired

When the server answered, ISO 8601 UTC

versionstringrequired

API version

pathstringoptional

The URL that was requested

201Imported
successbooleanrequired

true on every 2xx

dataobjectoptional

The result

Show 8 child properties
idstringrequired
phoneNumberstringrequired
countrystringrequired
monthlySubscriptionCoststring | nullrequired
importedbooleanrequired

True for a number imported from your own Twilio account. Imported numbers make outbound calls only.

createdAtstring (date-time) | string (date) | number | nullrequired
updatedAtstring (date-time) | string (date) | number | nullrequired
assistantNamestring | nullrequired
metadataobjectoptional

Request metadata

Show 3 child properties
timestampstringrequired

When the server answered, ISO 8601 UTC

versionstringrequired

API version

pathstringoptional

The URL that was requested

400The request is invalid. `details` lists each field that failed
successbooleanrequired

false on every error

errorobjectoptional

What went wrong: a stable `code` to branch on and a human-readable `message`

Show 3 child properties
codeenumrequired

A parameter or body field broke a rule

Allowed values:"VALIDATION_ERROR"
messagestringrequired

Human-readable explanation. Do not parse it; branch on `code`

detailsobject[]optional

One entry per field that failed

Show 2 item properties
fieldstringrequired

The offending field

messagestringrequired

The rule it broke

metadataobjectoptional

Request metadata

Show 3 child properties
timestampstringrequired

When the server answered, ISO 8601 UTC

versionstringrequired

API version

pathstringoptional

The URL that was requested

401Missing or invalid credentials
successbooleanrequired

false on every error

errorobjectoptional

What went wrong: a stable `code` to branch on and a human-readable `message`

Show 2 child properties
codeenumrequired

No valid credentials

Allowed values:"UNAUTHORIZED"
messagestringrequired

Human-readable explanation. Do not parse it; branch on `code`

metadataobjectoptional

Request metadata

Show 3 child properties
timestampstringrequired

When the server answered, ISO 8601 UTC

versionstringrequired

API version

pathstringoptional

The URL that was requested

403The credentials are valid but may not use this route
successbooleanrequired

false on every error

errorobjectoptional

What went wrong: a stable `code` to branch on and a human-readable `message`

Show 2 child properties
codeenumrequired

The credentials may not use this route

Allowed values:"FORBIDDEN"
messagestringrequired

Human-readable explanation. Do not parse it; branch on `code`

metadataobjectoptional

Request metadata

Show 3 child properties
timestampstringrequired

When the server answered, ISO 8601 UTC

versionstringrequired

API version

pathstringoptional

The URL that was requested

404Not found, or outside the caller's scope
successbooleanrequired

false on every error

errorobjectoptional

What went wrong: a stable `code` to branch on and a human-readable `message`

Show 2 child properties
codeenumrequired

An id names nothing the caller can see

Allowed values:"RESOURCE_NOT_FOUND"
messagestringrequired

Human-readable explanation. Do not parse it; branch on `code`

metadataobjectoptional

Request metadata

Show 3 child properties
timestampstringrequired

When the server answered, ISO 8601 UTC

versionstringrequired

API version

pathstringoptional

The URL that was requested

500An unexpected server error
successbooleanrequired

false on every error

errorobjectoptional

What went wrong: a stable `code` to branch on and a human-readable `message`

Show 2 child properties
codeenumrequired

An unexpected server failure

Allowed values:"INTERNAL_SERVER_ERROR"
messagestringrequired

Human-readable explanation. Do not parse it; branch on `code`

metadataobjectoptional

Request metadata

Show 3 child properties
timestampstringrequired

When the server answered, ISO 8601 UTC

versionstringrequired

API version

pathstringoptional

The URL that was requested