Skip to Content
SDKsPythonPhone Numbers

Phone Numbers

SendAfrica’s SDKs normalize recipient phone numbers for you before they touch the network.

Accepted formats

FormatExampleResult
Tanzania local0712345678Normalized to +255712345678
International with ++255712345678Passed through
International without +255712345678Normalized with country code

Tanzania mobile prefixes are 071078, 068, and 069. Anything else fails validation and raises InvalidPhoneError locally — before any request is sent.

Why normalization matters

  • The API expects E.164 on the wire; the SDK converts local numbers for you.
  • Validation happens before the network call, so typos fail fast instead of costing credits.
  • International destinations must be present in GET /v1/rates to be billable.

Test your own numbers

from sendafrica.utils import normalize_phone, is_valid_tz_mobile normalize_phone("0712345678") # '+255712345678' is_valid_tz_mobile("0712345678") # True

The same logic runs inside sms.send — send a top-up OTP to your own phone and check the message arrives with the to as you typed it.

Last updated on