Skip to content

Phone numbers

Phone numbers for calls and SMS: browse countries and prices, buy one (countries that regulate numbers ask for the registrant’s identity first: KYC), set where inbound calls go and turn SMS on. Owners and admins manage them; numbers bill monthly from the balance.

GET/v1/phone-numbers/countries

Where numbers can be bought, per number type: monthly price (cents), whether KYC is needed, SMS and stock.

Response 200

data []
  • codestringrequired

    ISO 3166-1 alpha-2.

  • needsKycbooleanrequired
  • typesobject[]required

    The default type first.

    types
    • numberTypestringrequired

      Values: local · mobile · national · toll_free

    • monthlyPriceintegerrequired

      Cents of euro per month.

      max 9,007,199,254,740,991

    • needsKycbooleanrequired
    • smsbooleanrequired
    • callsbooleanrequired
    • inStockbooleanrequired
    • preOrderablebooleanrequired

      Out of stock but orderable through KYC (usually 2 to 4 weeks).

Terminal window
curl "https://api.marsial.dev/v1/phone-numbers/countries" \
-H "Authorization: Bearer $MARSIAL_API_KEY"
GET/v1/phone-numbers/available

Live inventory of a country. Any result can be bought exactly with POST /phone-numbers (except in countries that need KYC).

Parameters

  • countrystringrequired

    ISO 3166-1 alpha-2 (GET /v1/phone-numbers/countries).

  • numberTypestring

    local, mobile, national or toll_free; the country's default when left out.

    Values: local · mobile · national · toll_free

  • areaCodestring

    Area code (91, 415) or a city name.

    max 40

  • localitystring

    A city of the country.

    max 80

  • containsstring

    Digits the number must contain.

  • smsstring

    Only numbers that can also send SMS.

    Values: true · false

  • limitinteger

    max 100

Response 200

data []
  • phoneNumberstringrequired

    E.164.

  • featuresstring[]required

    voice, sms, mms…

  • localitystring
  • bestEffortbooleanrequired

    Added because too few matched: may be outside the requested area.

Terminal window
curl "https://api.marsial.dev/v1/phone-numbers/available?country=GB&numberType=mobile&sms=true" \
-H "Authorization: Bearer $MARSIAL_API_KEY"
GET/v1/phone-numbers

Active numbers and those in review (declined ones stay listed for 30 days, with the reason).

Parameters

  • profileIdstring

    The profile whose numbers to list; without it, every profile's.

Response 200

data []
  • idstringrequired

    num_…

  • profileIdstringrequired
  • phoneNumberstring | nullrequired

    E.164; null until the carrier assigns it.

  • countrystringrequired
  • numberTypestring
  • statusstringrequired

    pending_regulatory while the carrier reviews the KYC; regulatory_declined with the reason in regulatory.

    Values: pending_payment · pending_regulatory · regulatory_declined · provisioning · verifying · active · suspended · releasing · released

  • monthlyPriceinteger

    Cents of euro per month, fixed when it was bought.

    max 9,007,199,254,740,991

  • callsobjectrequired
    calls
    • enabledbooleanrequired
    • forwardTostring

      Where inbound calls go: tel:+E164, sip:… or wss://….

    • voicemailEnabledboolean
    • voicemailGreetingstring
    • recordingEnabledboolean
    • transcriptionEnabledboolean
    • transcriptionLanguagestring

      Values: auto · en · es

    • businessHoursEnabledboolean
    • businessHoursTimezonestring
    • businessHoursobject[]
      businessHours
      • dayintegerrequired

        max 9,007,199,254,740,991

      • openstringrequired
      • closestringrequired
    • blockedCallersstring[]
    • forwardCallerIdstring

      Values: business · caller

  • smsobjectrequired
    sms
    • enabledbooleanrequired
    • capableboolean
    • sendApprovedboolean

      Texts deliver (US numbers need a carrier registration first).

    • domesticOnlyboolean

      Can only text numbers of its own country.

  • regulatoryobject
    regulatory
    • declineReasonstring
    • reviewCommentstring
    • actionRequiredbooleanrequired
    • idVerificationUrlstring

      Identity check for the registrant, once the order is placed (some countries).

  • createdAtstring (date-time)
  • activatedAtstring (date-time)
  • smsNoticestring

    After turning SMS on, what else it needs.

Terminal window
curl "https://api.marsial.dev/v1/phone-numbers?profileId=prf_8f2k4d" \
-H "Authorization: Bearer $MARSIAL_API_KEY"
POST/v1/phone-numbers

Owners and admins. Needs at least one month of the number in the balance. Countries that regulate numbers answer 202 kyc_required: send the registrant's identity with POST /phone-numbers/kyc.

Body

  • profileIdstringrequired
  • countrystringrequired
  • numberTypestring

    local, mobile, national or toll_free; the country's default when left out.

    Values: local · mobile · national · toll_free

  • phoneNumberstring

    One exact number from GET /v1/phone-numbers/available. Not for countries that need KYC.

  • areaCodestring

    Any number in this area (when phoneNumber is left out).

  • smsboolean

    Pick a number that can send SMS and turn SMS on.

  • idempotencyKeystring

    Send the same value when retrying, so a retry never buys a second number.

    max 100

Response 201

data
  • idstringrequired

    num_…

  • profileIdstringrequired
  • phoneNumberstring | nullrequired

    E.164; null until the carrier assigns it.

  • countrystringrequired
  • numberTypestring
  • statusstringrequired

    pending_regulatory while the carrier reviews the KYC; regulatory_declined with the reason in regulatory.

    Values: pending_payment · pending_regulatory · regulatory_declined · provisioning · verifying · active · suspended · releasing · released

  • monthlyPriceinteger

    Cents of euro per month, fixed when it was bought.

    max 9,007,199,254,740,991

  • callsobjectrequired
    calls
    • enabledbooleanrequired
    • forwardTostring

      Where inbound calls go: tel:+E164, sip:… or wss://….

    • voicemailEnabledboolean
    • voicemailGreetingstring
    • recordingEnabledboolean
    • transcriptionEnabledboolean
    • transcriptionLanguagestring

      Values: auto · en · es

    • businessHoursEnabledboolean
    • businessHoursTimezonestring
    • businessHoursobject[]
      businessHours
      • dayintegerrequired

        max 9,007,199,254,740,991

      • openstringrequired
      • closestringrequired
    • blockedCallersstring[]
    • forwardCallerIdstring

      Values: business · caller

  • smsobjectrequired
    sms
    • enabledbooleanrequired
    • capableboolean
    • sendApprovedboolean

      Texts deliver (US numbers need a carrier registration first).

    • domesticOnlyboolean

      Can only text numbers of its own country.

  • regulatoryobject
    regulatory
    • declineReasonstring
    • reviewCommentstring
    • actionRequiredbooleanrequired
    • idVerificationUrlstring

      Identity check for the registrant, once the order is placed (some countries).

  • createdAtstring (date-time)
  • activatedAtstring (date-time)
  • smsNoticestring

    After turning SMS on, what else it needs.

Terminal window
curl -X POST "https://api.marsial.dev/v1/phone-numbers" \
-H "Authorization: Bearer $MARSIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"profileId": "prf_8f2k4d",
"country": "GB",
"numberType": "mobile",
"sms": true
}'
GET/v1/phone-numbers/kyc

What the carrier needs to know about whoever holds the number: text, date, address, documents, and sometimes an identity check done later (action).

Parameters

  • countrystringrequired
  • numberTypestring

    local, mobile, national or toll_free; the country's default when left out.

    Values: local · mobile · national · toll_free

Response 200

data
  • countrystringrequired
  • numberTypestring
  • fieldsobject[]required
    fields
    • requirementIdstringrequired
    • labelstringrequired
    • kindstringrequired

      file: upload it first; action: an identity check done later through a link.

      Values: text · date · address · file · action

    • descriptionstring
    • examplestring
    • localTostring

      ISO country the value must be local to.

Terminal window
curl "https://api.marsial.dev/v1/phone-numbers/kyc?country=ES" \
-H "Authorization: Bearer $MARSIAL_API_KEY"
POST/v1/phone-numbers/kyc

Orders the number of a regulated country with the registrant's identity. It waits in the carrier's review (pending_regulatory, usually 1 to 3 business days) and bills only once active. When the form had an identity check, the number gets regulatory.idVerificationUrl to send to the registrant.

Body

  • profileIdstringrequired
  • countrystringrequired
  • numberTypestring

    local, mobile, national or toll_free; the country's default when left out.

    Values: local · mobile · national · toll_free

  • valuesobject

    requirementId → value, for text and date fields.

  • documentsobject[]

    max 20 items

    documents
    • requirementIdstringrequired
    • documentIdstringrequired

      From POST /v1/phone-numbers/kyc/documents.

  • addressobject
    address
    • requirementIdstringrequired
    • countryCodestringrequired
    • streetAddressstringrequired

      max 200

    • extendedAddressstring

      max 200

    • localitystringrequired

      max 100

    • administrativeAreastring

      max 100

    • postalCodestringrequired

      max 20

  • endUserFirstNamestring

    Legal first name, when the form has an identity check (action).

    max 100

  • endUserLastNamestring

    max 100

  • areaCodestring
  • phoneNumberstring
  • smsboolean
  • preOrderboolean

    Accept sourcing a number when the area has no stock (usually 2 to 4 weeks).

  • submissionIdstring

    Send the same value when retrying, so a retry never orders a second number.

    max 100

Response 202

data
  • numbersobject[]required
    numbers
    • idstringrequired

      num_…

    • profileIdstringrequired
    • phoneNumberstring | nullrequired

      E.164; null until the carrier assigns it.

    • countrystringrequired
    • numberTypestring
    • statusstringrequired

      pending_regulatory while the carrier reviews the KYC; regulatory_declined with the reason in regulatory.

      Values: pending_payment · pending_regulatory · regulatory_declined · provisioning · verifying · active · suspended · releasing · released

    • monthlyPriceinteger

      Cents of euro per month, fixed when it was bought.

      max 9,007,199,254,740,991

    • callsobjectrequired
      calls
      • enabledbooleanrequired
      • forwardTostring

        Where inbound calls go: tel:+E164, sip:… or wss://….

      • voicemailEnabledboolean
      • voicemailGreetingstring
      • recordingEnabledboolean
      • transcriptionEnabledboolean
      • transcriptionLanguagestring

        Values: auto · en · es

      • businessHoursEnabledboolean
      • businessHoursTimezonestring
      • businessHoursobject[]
        businessHours
        • dayintegerrequired

          max 9,007,199,254,740,991

        • openstringrequired
        • closestringrequired
      • blockedCallersstring[]
      • forwardCallerIdstring

        Values: business · caller

    • smsobjectrequired
      sms
      • enabledbooleanrequired
      • capableboolean
      • sendApprovedboolean

        Texts deliver (US numbers need a carrier registration first).

      • domesticOnlyboolean

        Can only text numbers of its own country.

    • regulatoryobject
      regulatory
      • declineReasonstring
      • reviewCommentstring
      • actionRequiredbooleanrequired
      • idVerificationUrlstring

        Identity check for the registrant, once the order is placed (some countries).

    • createdAtstring (date-time)
    • activatedAtstring (date-time)
    • smsNoticestring

      After turning SMS on, what else it needs.

  • preOrderbooleanrequired

    The carrier sources the number (usually 2 to 4 weeks); nothing is billed until it is active.

Terminal window
curl -X POST "https://api.marsial.dev/v1/phone-numbers/kyc" \
-H "Authorization: Bearer $MARSIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"profileId": "prf_8f2k4d",
"country": "ES",
"values": {
"d7e8f9a0-…": "Acme SL"
},
"documents": [
{
"requirementId": "e8f9a0b1-…",
"documentId": "kdoc_…"
}
],
"address": {
"requirementId": "f9a0b1c2-…",
"countryCode": "ES",
"streetAddress": "Gran Vía 1",
"locality": "Madrid",
"postalCode": "28013"
}
}'
POST/v1/phone-numbers/kyc/documents

One file (PDF, JPEG or PNG, up to 4 MB, in base64). It goes straight to the carrier; Marsial keeps nothing. Use the returned id in POST /phone-numbers/kyc.

Body

  • filenamestringrequired

    max 200

  • contentTypestringrequired

    Values: application/pdf · image/jpeg · image/png

  • datastringrequired

    The file in base64, up to 4 MB. For an ID card, both sides in one file.

    max 6,000,000

Response 201

data
  • documentIdstringrequired

    kdoc_…

Terminal window
curl -X POST "https://api.marsial.dev/v1/phone-numbers/kyc/documents" \
-H "Authorization: Bearer $MARSIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filename": "id.pdf",
"contentType": "application/pdf",
"data": "JVBERi0xLjQK…"
}'
GET/v1/phone-numbers/{id}

Parameters

  • idstringrequired

Response 200

data
  • idstringrequired

    num_…

  • profileIdstringrequired
  • phoneNumberstring | nullrequired

    E.164; null until the carrier assigns it.

  • countrystringrequired
  • numberTypestring
  • statusstringrequired

    pending_regulatory while the carrier reviews the KYC; regulatory_declined with the reason in regulatory.

    Values: pending_payment · pending_regulatory · regulatory_declined · provisioning · verifying · active · suspended · releasing · released

  • monthlyPriceinteger

    Cents of euro per month, fixed when it was bought.

    max 9,007,199,254,740,991

  • callsobjectrequired
    calls
    • enabledbooleanrequired
    • forwardTostring

      Where inbound calls go: tel:+E164, sip:… or wss://….

    • voicemailEnabledboolean
    • voicemailGreetingstring
    • recordingEnabledboolean
    • transcriptionEnabledboolean
    • transcriptionLanguagestring

      Values: auto · en · es

    • businessHoursEnabledboolean
    • businessHoursTimezonestring
    • businessHoursobject[]
      businessHours
      • dayintegerrequired

        max 9,007,199,254,740,991

      • openstringrequired
      • closestringrequired
    • blockedCallersstring[]
    • forwardCallerIdstring

      Values: business · caller

  • smsobjectrequired
    sms
    • enabledbooleanrequired
    • capableboolean
    • sendApprovedboolean

      Texts deliver (US numbers need a carrier registration first).

    • domesticOnlyboolean

      Can only text numbers of its own country.

  • regulatoryobject
    regulatory
    • declineReasonstring
    • reviewCommentstring
    • actionRequiredbooleanrequired
    • idVerificationUrlstring

      Identity check for the registrant, once the order is placed (some countries).

  • createdAtstring (date-time)
  • activatedAtstring (date-time)
  • smsNoticestring

    After turning SMS on, what else it needs.

Terminal window
curl "https://api.marsial.dev/v1/phone-numbers/num_…" \
-H "Authorization: Bearer $MARSIAL_API_KEY"
DELETE/v1/phone-numbers/{id}

Owners and admins. Gives the number back and stops billing it; a number in review or a pre-order is cancelled. It cannot be recovered.

Parameters

  • idstringrequired

Response 204

No content

Terminal window
curl -X DELETE "https://api.marsial.dev/v1/phone-numbers/num_…" \
-H "Authorization: Bearer $MARSIAL_API_KEY"
PATCH/v1/phone-numbers/{id}/calls

Where calls go (a phone, a SIP address or an AI voice agent over wss://), voicemail, business hours, blocked callers, recording and transcription. Only the fields sent change.

Parameters

  • idstringrequired

Body

  • enabledboolean

    false turns calls off on the number (settings are kept).

  • forwardTostring | ""

    Where inbound calls go: tel:+E164, sip:… or wss://… (an AI voice agent). Empty clears it.

  • voicemailEnabledboolean
  • voicemailGreetingstring

    max 500

  • recordingEnabledboolean

    Records calls (a consent notice plays first).

  • transcriptionEnabledboolean
  • transcriptionLanguagestring

    Values: auto · en · es

  • businessHoursEnabledboolean
  • businessHoursTimezonestring

    IANA time zone, e.g. Europe/Madrid.

    max 60

  • businessHoursobject[]

    max 21 items

    businessHours
    • dayintegerrequired

      0 is Sunday.

      max 6

    • openstringrequired
    • closestringrequired
  • blockedCallersstring[]

    Replaces the whole list.

    max 500 items

  • forwardCallerIdstring

    Values: business · caller

Response 200

data
  • idstringrequired

    num_…

  • profileIdstringrequired
  • phoneNumberstring | nullrequired

    E.164; null until the carrier assigns it.

  • countrystringrequired
  • numberTypestring
  • statusstringrequired

    pending_regulatory while the carrier reviews the KYC; regulatory_declined with the reason in regulatory.

    Values: pending_payment · pending_regulatory · regulatory_declined · provisioning · verifying · active · suspended · releasing · released

  • monthlyPriceinteger

    Cents of euro per month, fixed when it was bought.

    max 9,007,199,254,740,991

  • callsobjectrequired
    calls
    • enabledbooleanrequired
    • forwardTostring

      Where inbound calls go: tel:+E164, sip:… or wss://….

    • voicemailEnabledboolean
    • voicemailGreetingstring
    • recordingEnabledboolean
    • transcriptionEnabledboolean
    • transcriptionLanguagestring

      Values: auto · en · es

    • businessHoursEnabledboolean
    • businessHoursTimezonestring
    • businessHoursobject[]
      businessHours
      • dayintegerrequired

        max 9,007,199,254,740,991

      • openstringrequired
      • closestringrequired
    • blockedCallersstring[]
    • forwardCallerIdstring

      Values: business · caller

  • smsobjectrequired
    sms
    • enabledbooleanrequired
    • capableboolean
    • sendApprovedboolean

      Texts deliver (US numbers need a carrier registration first).

    • domesticOnlyboolean

      Can only text numbers of its own country.

  • regulatoryobject
    regulatory
    • declineReasonstring
    • reviewCommentstring
    • actionRequiredbooleanrequired
    • idVerificationUrlstring

      Identity check for the registrant, once the order is placed (some countries).

  • createdAtstring (date-time)
  • activatedAtstring (date-time)
  • smsNoticestring

    After turning SMS on, what else it needs.

Terminal window
curl -X PATCH "https://api.marsial.dev/v1/phone-numbers/num_…/calls" \
-H "Authorization: Bearer $MARSIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"forwardTo": "tel:+34600111222",
"recordingEnabled": true
}'
PUT/v1/phone-numbers/{id}/sms

Only numbers that can text. US numbers also need a carrier registration (10DLC) that Marsial does not offer yet.

Parameters

  • idstringrequired

Body

  • enabledbooleanrequired

Response 200

data
  • idstringrequired

    num_…

  • profileIdstringrequired
  • phoneNumberstring | nullrequired

    E.164; null until the carrier assigns it.

  • countrystringrequired
  • numberTypestring
  • statusstringrequired

    pending_regulatory while the carrier reviews the KYC; regulatory_declined with the reason in regulatory.

    Values: pending_payment · pending_regulatory · regulatory_declined · provisioning · verifying · active · suspended · releasing · released

  • monthlyPriceinteger

    Cents of euro per month, fixed when it was bought.

    max 9,007,199,254,740,991

  • callsobjectrequired
    calls
    • enabledbooleanrequired
    • forwardTostring

      Where inbound calls go: tel:+E164, sip:… or wss://….

    • voicemailEnabledboolean
    • voicemailGreetingstring
    • recordingEnabledboolean
    • transcriptionEnabledboolean
    • transcriptionLanguagestring

      Values: auto · en · es

    • businessHoursEnabledboolean
    • businessHoursTimezonestring
    • businessHoursobject[]
      businessHours
      • dayintegerrequired

        max 9,007,199,254,740,991

      • openstringrequired
      • closestringrequired
    • blockedCallersstring[]
    • forwardCallerIdstring

      Values: business · caller

  • smsobjectrequired
    sms
    • enabledbooleanrequired
    • capableboolean
    • sendApprovedboolean

      Texts deliver (US numbers need a carrier registration first).

    • domesticOnlyboolean

      Can only text numbers of its own country.

  • regulatoryobject
    regulatory
    • declineReasonstring
    • reviewCommentstring
    • actionRequiredbooleanrequired
    • idVerificationUrlstring

      Identity check for the registrant, once the order is placed (some countries).

  • createdAtstring (date-time)
  • activatedAtstring (date-time)
  • smsNoticestring

    After turning SMS on, what else it needs.

Terminal window
curl -X PUT "https://api.marsial.dev/v1/phone-numbers/num_…/sms" \
-H "Authorization: Bearer $MARSIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true
}'

© 2026 Marsial by TWOFACES ·marsial.dev ·Dashboard ·soporte@twofacesco.com