CtrlK
BlogDocsLog inGet started
Tessl Logo

sinch-partnerships-ecosystems/sinch-skills

Official Sinch API skills for AI coding agents — SMS, Voice, Verification, Numbers, Mailgun email, and more.

71

Quality

89%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

SKILL.mdskills/sinch-number-lookup-api/

name:
sinch-number-lookup-api
description:
Looks up phone number details via Sinch Number Lookup API. Use when checking carrier, line type, porting status, SIM swap, VoIP detection, or reassigned number detection (RND) for fraud prevention or routing decisions.
metadata:
{"author":"Sinch","version":"1.0.5","category":"Numbers","tags":"number-lookup, carrier, line-type, sim-swap, voip-detection, fraud-prevention","uses":["sinch-authentication","sinch-sdks"]}

Sinch Number Lookup API

Overview

Queries phone numbers for carrier, line type, porting, SIM swap, VoIP detection, and reassigned number detection. Used for fraud prevention, routing, and data enrichment. One number per request — no batch endpoint.

Agent Instructions

Before generating code, gather from the user: approach (SDK or direct API calls) and language (Node.js, Python, Java, .NET/C#, curl). Do not assume defaults.

When the user chooses SDK, refer to sinch-sdks for installation, client initialization, and language-specific references. Note: Number Lookup is only supported in Node.js and Python (partial) SDKs — for Java and .NET, use direct HTTP calls.

Getting Started

Agent Credentials handling

Store credentials in environment variables — never hardcode tokens or keys in commands or source code:

export SINCH_PROJECT_ID="your-project-id"
export SINCH_KEY_ID="your-key-id"
export SINCH_KEY_SECRET="your-key-secret"
export SINCH_ACCESS_TOKEN="your-oauth-token"

Authentication

Ensure that authentication headers are properly set when making API calls. The Number Lookup API uses Bearer token authentication:

-H "Authorization: Bearer $SINCH_ACCESS_TOKEN"

See sinch-authentication for full setup, most importantly how to obtain {SINCH_ACCESS_TOKEN} (OAuth2 client-credentials — do not mint your own JWT).

Base URL

https://lookup.api.sinch.com

Endpoint: POST /v2/projects/{PROJECT_ID}/lookups

First API Call

curl -X POST \
  "https://lookup.api.sinch.com/v2/projects/$SINCH_PROJECT_ID/lookups" \
  -H "Authorization: Bearer $SINCH_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "number": "+12025550134",
    "features": ["LineType", "SimSwap", "VoIPDetection", "RND"],
    "rndFeatureOptions": { "contactDate": "2025-01-01" }
  }'

For SDK setup (Node.js, Python, Java, .NET), see the Getting Started Guide.

Request

FieldTypeRequiredNotes
numberstringYesSingle E.164 number (with + prefix)
featuresstring[]NoLineType (default), SimSwap, VoIPDetection (alpha), RND (alpha)
rndFeatureOptions.contactDatestringIf RND requestedYYYY-MM-DD format

Critical: If features is omitted, only LineType is returned. You must explicitly request SimSwap, VoIPDetection, or RND.

Response

Flat object (not an array). Each feature populates its own sub-object; unrequested features are null.

Top-level fields: number, countryCode (ISO 3166-1 alpha-2), traceId

line object:

FieldTypeValues
carrierstringCarrier name, e.g. "T-Mobile USA"
typestring enumLandline, Mobile, VoIP, Special, Freephone, Other
mobileCountryCodestringMCC, e.g. "310"
mobileNetworkCodestringMNC, e.g. "260"
portedbooleanWhether ported
portingDatestringISO 8601 datetime
errorobject|nullPer-feature error (status, title, detail, type)

simSwap object:

FieldTypeValues
swappedbooleanWhether SIM swap occurred
swapPeriodstring enumUndefined, SP4H, SP12H, SP24H, SP48H, SP5D, SP7D, SP14D, SP30D, SPMAX
errorobject|nullPer-feature error

voIPDetection object (alpha):

FieldTypeValues
probabilitystring enumUnknown, Low, Likely, High -- not numeric
errorobject|nullPer-feature error

rnd object (alpha):

FieldTypeValues
disconnectedbooleanDisconnected after contactDate
errorobject|nullPer-feature error

For full response schemas, see the API Reference.

Common Workflows

1. Fraud check before verification

  1. Look up the number with features: ["SimSwap", "VoIPDetection"]
  2. If simSwap.swapped is true and swapPeriod is SP4H or SP24H → flag as high risk
  3. If voIPDetection.probability is High or Likely → require additional verification
  4. If either feature returns a non-null error → fall back to the other feature's result for risk scoring
  5. Otherwise → proceed with SMS/voice verification

2. Pre-send number hygiene

  1. Look up the number with features: ["LineType", "RND"] (include rndFeatureOptions.contactDate)
  2. If rnd.disconnected is true → remove from contact list
  3. Route based on line.type: SMS for Mobile, voice for Landline

3. Combined lookup + verification

  1. Look up the number with features: ["LineType", "SimSwap"]
  2. If line.type is Landline → use voice verification instead of SMS
  3. If simSwap.swapped is true → skip SMS verification, use an alternative channel
  4. See Combined Lookup + Verification for the full flow.

4. Multiple numbers

No batch endpoint. Use parallel requests:

const results = await Promise.all(
  numbers.map((number) => sinch.numberLookup.lookup({ number, features: ['LineType', 'SimSwap'] }))
);

Gotchas

  1. features must be explicit. Omitting it returns only LineType. SIM swap, VoIP, and RND require explicit opt-in.
  2. VoIP probability is a string enum, not a 0–1 score. Values: Unknown, Low, Likely, High.
  3. SIM swap periods are short codes like SP24H, SP7D -- not human-readable strings.
  4. Partial failures are possible. Each feature sub-object has its own error. A lookup can succeed for line but fail for simSwap.
  5. RND requires contactDate. Omitting rndFeatureOptions when requesting RND causes a 400.
  6. SIM swap depends on carrier support. Not available for all numbers or regions.
  7. VoIPDetection and RND are alpha. Behavior may change.
  8. Rate limiting. 429 Too Many Requests when exceeded. Contact Sinch for tier info.
  9. Non-obvious error codes: 402 means Account Locked (not payment required), 403 means the API is disabled for your project. If response includes a 403, direct the user to check this documentation.

Links

skills

sinch-number-lookup-api

README.md

tile.json