Check iMessage support
Look up phone numbers and email addresses and handle inconclusive results.
Use GET /api/evaluate-service to check iMessage support for a phone number or email address. A lookup does not verify that a phone number is real, identify someone’s device, or guarantee message delivery.
Run a lookup
Section titled “Run a lookup”Set SENDBLUE_API_KEY_ID and SENDBLUE_API_SECRET_KEY to your API credentials, then pass the recipient in the number query parameter. Use E.164 format for phone numbers.
curl --get 'https://api.sendblue.com/api/evaluate-service' \ --header "sb-api-key-id: $SENDBLUE_API_KEY_ID" \ --header "sb-api-secret-key: $SENDBLUE_API_SECRET_KEY" \ --data-urlencode 'number=+14155550100'For an email lookup, set number to [email protected].
A successful lookup returns HTTP 200 with the normalized recipient and its service:
{ "number": "+14155550100", "service": "iMessage"}iMessagemeans iMessage support was detected.SMSmeans iMessage support was not detected. For an email address, it does not mean the address can receive SMS.
A valid negative result still returns HTTP 200 with service: "SMS".
Handle an inconclusive lookup
Section titled “Handle an inconclusive lookup”If the service lookup is inconclusive, the API returns HTTP 502:
{ "status": "ERROR", "code": "EVALUATE_SERVICE_INDETERMINATE", "message": "Unable to determine service. Please retry."}Treat this response as unknown, and keep it separate from a successful SMS result. Do not cache it as SMS or use it as proof that the recipient lacks iMessage.
Retry a limited number of times with exponential backoff and jitter. If the lookup remains inconclusive, stop retrying and surface the failure to your application. An inconclusive response does not cache a service result.
Other errors
Section titled “Other errors”| HTTP status | What to do |
|---|---|
400 | Check the recipient format. |
401 | Check your API credentials. |
403 | Check that your account and API credentials allow the lookup. |
429 | Wait for your lookup quota to reset before retrying. |
Rate Limits
Section titled “Rate Limits”Lookups have their own separate rate limits and do not count against your message sending limits. Cache hits and inconclusive lookups still count toward lookup limits.
| Limit | Default |
|---|---|
| Lookups per hour | 30/line |
| Lookups per day | 100/line |
| Maximum (upon request) | 400/day/line |
Increases apply at the account level. Contact your account manager to request an increase.