# Introduction Source: https://docs.contiguity.com/api-reference/introduction Build using Contiguity's API. ## Getting Started Use of Contiguity's services requires an account to be made with Contiguity. This, apart from needing a connection to the internet, is all you need to begin using Contiguity. > **[Create an Account](https://console.contiguity.com)** > > Sign up for a Contiguity account to access our services > [!NOTE] > > The API only accepts JSON. Ensure you set the `Content-Type` header to `application/json` to avoid errors. ## Base URLs When sending requests, the base URL for your requests will likely be: ``` https://api.contiguity.com/ ``` However, for some data or requests, you may encounter base URLs such as: > **orwell.contiguity.com** > > You'd make requests here if you're fetching data from our analytics platform, Orwell. > **api.identity.contiguity.com** > > You'd make requests here when using our identity service, Identity. > **api.base.contiguity.co** > > You'd make requests here when using our NoSQL database service, Base. > **api.compliance.contiguity.com** > > You'd make requests here when using our regulatory compliance service, Compliance. We'll let you know if you're sending a request to a base URL different from `api.contiguity.com`. ## Authentication When using the API, attach an `Authorization` header that's equal to `Token YOUR_TOKEN_HERE` in each request. > [!NOTE] > > Authentication is required for most endpoints Contiguity provides. ## API Best Practices ### Avoid "spamming" the API While Contiguity's API can scale and is meant to handle millions of requests, it still rate limits users beyond a certain amount of requests per second. Avoid, for example, polling `/otp/verify` with every digit your user types - instead wait for all 6 digits before requesting verification. ### Respect local laws Contiguity was designed to not be required to follow certain 'regulations', i.e A2P 10DLC registration in the US. However, it is still up to you, the user, to follow all laws applicable to you (i.e, in the US, CAN-SPAM) - not Contiguity's. ## API Status Contiguity strives for >99.99% uptime. In the event Contiguity begins to return any `5xx` error, check Contiguity's [status page](https://status.contiguity.com). If an incident hasn't been marked as `Investigating`, please notify Contiguity immediately via email ([help@contiguity.support](mailto:help@contiguity.support)) or [Discord](https://discord.gg/pCuTaY84Vy) ![](https://fake.img.com/nonexistent.jpg) # Register a domain Source: https://docs.contiguity.com/api-reference/product/email/domains/add openapi-domains POST /{domain} Register a domain to your Contiguity account ![](https://fake.img.com/nonexistent.jpg) # Delete a domain Source: https://docs.contiguity.com/api-reference/product/email/domains/delete openapi-domains DELETE /{domain} Delete a domain from your Contiguity account ![](https://fake.img.com/nonexistent.jpg) # Get a domain Source: https://docs.contiguity.com/api-reference/product/email/domains/get openapi-domains GET /{domain} Get details about a domain > [!NOTE] > > We'll return DNS records for the domain regardless of its verification status. ![](https://fake.img.com/nonexistent.jpg) # List domains Source: https://docs.contiguity.com/api-reference/product/email/domains/list openapi-domains GET / List all domains registered to your Contiguity account ![](https://fake.img.com/nonexistent.jpg) # Send an Email Source: https://docs.contiguity.com/api-reference/product/email/send openapi-send POST /email Send an email > [!WARNING] > > `from` behavior is highly dependent on your account's setup! > [!NOTE] > > The sender email configuration depends on your account setup: > > * If you haven't verified a domain: You can only use Contiguity's email infrastructure. Simply provide your sender name (e.g. 'Contiguity'). > > * If you have verified a domain: You can either: > * Use your verified domain (e.g. 'Contiguity \<[custom@your-domain.com](mailto:custom@your-domain.com)>') > * Or still use Contiguity's email address (e.g. 'Contiguity \<[random-hash@contiguity.email](mailto:random-hash@contiguity.email)>') > [!NOTE] > > **Deprecated:** `body` > > ```json theme={null} > { > "body": {, > "html": "

Hello, world!

", > "text": "Hello, world!" > } > } > ``` > > **Instead, provide top-level `html` / `text` properties.** > > ```json theme={null} > { > ..., > "html": "

Hello, world!

", > "text": "Hello, world!" > } > ``` ![](https://fake.img.com/nonexistent.jpg) # Apply for entitlement Source: https://docs.contiguity.com/api-reference/product/entitlements/apply openapi-entitlements POST /{name} Apply for an entitlement > [!WARNING] > > Some entitlements are governed by additional legal agreements. Review applicable terms before applying for entitlements at [contiguity.com/legal](https://contiguity.com/legal). > [!NOTE] > > Some entitlements may appear as `eligible` in the Console, but you may be denied. Contiguity assesses each entitlement application on a case-by-case basis using basic criteria and machine learning. ![](https://fake.img.com/nonexistent.jpg) # Get entitlement Source: https://docs.contiguity.com/api-reference/product/entitlements/get openapi-entitlements GET /{name} View a specific entitlement status ![](https://fake.img.com/nonexistent.jpg) # List entitlements Source: https://docs.contiguity.com/api-reference/product/entitlements/list openapi-entitlements GET / List all entitlements and their status for your account ![](https://fake.img.com/nonexistent.jpg) # Revoke entitlement Source: https://docs.contiguity.com/api-reference/product/entitlements/revoke openapi-entitlements DELETE /{name} Revoke an entitlement from your account ![](https://fake.img.com/nonexistent.jpg) # Answer a FaceTime call Source: https://docs.contiguity.com/api-reference/product/facetime/answer openapi-facetime POST /{call_id}/answer Answer an inbound FaceTime call > [!NOTE] > > This endpoint is for inbound calls. Answering moves the call to `in_progress` and fires [`facetime.call.answered`](/api-reference/webhook/events#facetime-call-answered). `caller_id` is optional. Use it to present a name on the call. ![](https://fake.img.com/nonexistent.jpg) # Check FaceTime Availability Source: https://docs.contiguity.com/api-reference/product/facetime/availability openapi-facetime GET /availability/{to} Check if a phone number or email supports FaceTime > [!NOTE] > > `to` accepts an E.164 phone number or a FaceTime email. ![](https://fake.img.com/nonexistent.jpg) # Dial a FaceTime call Source: https://docs.contiguity.com/api-reference/product/facetime/dial openapi-facetime POST /dial Place an outbound FaceTime Audio call > [!NOTE] > > Only customers who lease numbers that support FaceTime Audio can use this endpoint. > [!WARNING] > > Phone numbers must be in E.164 format with country codes. `to` can also be a FaceTime email. Dialing creates a call in `queued` and fires [`facetime.call.initiated`](/api-reference/webhook/events#facetime-call-initiated). When the remote side starts ringing, status becomes `ringing` and Contiguity fires [`facetime.call.ringing`](/api-reference/webhook/events#facetime-call-ringing). If you omit `from`, Contiguity picks one of your leased FaceTime Audio numbers at random. `caller_id` is optional and is presented as `Maybe: caller_id` to the recipient. If not provided, it will be a formatted version of your leased number, e.g., `Maybe: +1 (415) 555-1234` The response is the same call object returned by [Get a call](/api-reference/product/facetime/get). At dial time `link` is `null`, `participants` is `[]`, and `duration` is `null`. > **[Join as the number](https://facetime.contiguity.com)** > > `webrtc.join` opens the call as the Contiguity FaceTime Audio line — not a third participant. > **FaceTime Web** > > Once Apple creates it, `link` is a FaceTime Web URL. Opening it joins the call in the browser as a web participant. ![](https://fake.img.com/nonexistent.jpg) # Get a FaceTime call Source: https://docs.contiguity.com/api-reference/product/facetime/get openapi-facetime GET /{call_id} Fetch a FaceTime call by ID Returns the call object. FaceTime webhooks send this same object in `data`. ## Status | `status` | meaning | | - | - | | `queued` | Outbound dial created the call | | `ringing` | Outbound is ringing, or an inbound call arrived | | `in_progress` | The call was answered | | `completed` | The call ended (you hung up, they hung up, or FaceTime disconnected) | | `failed` | Contiguity could not place the call | `cause` is `null` while the call is live. After hangup it is `dialer_hungup` if you [hang up](/api-reference/product/facetime/hangup), `recipient_hungup` if the remote party left, or another end reason. ## Participants `participants` is the current roster while the call is live. After the call ends it is whoever remained, not everyone who was ever on the call. | stage | `participants` | | - | - | | initiated / ringing | `[]` | | answered | The remote party, e.g. `["+15559876543"]` | | ended | Remaining handles after hangup. If the recipient already left, this is often just your FaceTime Audio line. | ## Media `link` is a FaceTime Web URL, once Apple has created it. It is `null` during `queued` and `ringing`. Opening it joins as a web participant. `webrtc` is present while the call is active and `null` after it ends. `webrtc.join` is a URL that connects you as the Contiguity FaceTime Audio line. `url`, `room`, and `token` are the raw WebRTC credentials. `duration` is seconds of connected time. It stays `null` until the call ends. ![](https://fake.img.com/nonexistent.jpg) # Hang up a FaceTime call Source: https://docs.contiguity.com/api-reference/product/facetime/hangup openapi-facetime POST /{call_id}/hangup Hang up a FaceTime call Ends the call from your side. `cause` becomes `dialer_hungup` and Contiguity fires [`facetime.call.ended`](/api-reference/webhook/events#facetime-call-ended). If the remote party hangs up first, you still get `facetime.call.ended` with `cause` `recipient_hungup`. You do not need to call this endpoint in that case. ![](https://fake.img.com/nonexistent.jpg) # Reject a FaceTime call Source: https://docs.contiguity.com/api-reference/product/facetime/reject openapi-facetime POST /{call_id}/reject Reject a ringing inbound FaceTime call > [!NOTE] > > This endpoint is for inbound calls that are still ringing. Rejecting fires [`facetime.call.rejected`](/api-reference/webhook/events#facetime-call-rejected). ![](https://fake.img.com/nonexistent.jpg) # Get a Verification Report Source: https://docs.contiguity.com/api-reference/product/identity/vr/get openapi-identity GET /vr Fetch a Verification Report by its ID. > [!NOTE] > > Public API documentation is coming soon. > [!WARNING] > > This endpoint requires an Identity Entitlement ![](https://fake.img.com/nonexistent.jpg) # Redact a Verification Report Source: https://docs.contiguity.com/api-reference/product/identity/vr/redact openapi-identity POST /vr/redact Redact a Verification Report to remove sensitive data. > [!NOTE] > > Public API documentation is coming soon. > [!WARNING] > > This endpoint requires an Identity Entitlement ![](https://fake.img.com/nonexistent.jpg) # Cancel a Verification Session Source: https://docs.contiguity.com/api-reference/product/identity/vs/cancel openapi-identity POST /vs/cancel Cancel a Verification Session > [!NOTE] > > Public API documentation is coming soon. > [!WARNING] > > This endpoint requires an Identity Entitlement ![](https://fake.img.com/nonexistent.jpg) # Create a Verification Session Source: https://docs.contiguity.com/api-reference/product/identity/vs/create openapi-identity POST /vs/create Create a Verification Session > [!NOTE] > > Public API documentation is coming soon. > [!WARNING] > > This endpoint requires an Identity Entitlement ![](https://fake.img.com/nonexistent.jpg) # Get a Verification Session Source: https://docs.contiguity.com/api-reference/product/identity/vs/get openapi-identity GET /vs Fetch a Verification Session by its ID. > [!NOTE] > > Public API documentation is coming soon. > [!WARNING] > > This endpoint requires an Identity Entitlement ![](https://fake.img.com/nonexistent.jpg) # Check iMessage Availability Source: https://docs.contiguity.com/api-reference/product/imessage/availability openapi-conversations GET /availability/imessage/{to} Check if your recipient's phone number supports iMessage ![](https://fake.img.com/nonexistent.jpg) # Get Conversation History Source: https://docs.contiguity.com/api-reference/product/imessage/history openapi-conversations GET /history/imessage/{to}/{from}/{limit} Get iMessage conversation history for a chat > [!NOTE] > > Contiguity supports iCloud emails... but their behavior is unpredictable at times. ![](https://fake.img.com/nonexistent.jpg) # Add or Remove Reactions Source: https://docs.contiguity.com/api-reference/product/imessage/reactions openapi-send POST /imessage/reactions Add or remove a reaction to an iMessage > [!NOTE] > > Contiguity supports iCloud emails... but their behavior is unpredictable at times. ![](https://fake.img.com/nonexistent.jpg) # Mark as Read Source: https://docs.contiguity.com/api-reference/product/imessage/read openapi-send POST /imessage/read Mark a conversation as read ![](https://fake.img.com/nonexistent.jpg) # Send iMessage Source: https://docs.contiguity.com/api-reference/product/imessage/send openapi-send POST /imessage Send an iMessage > [!NOTE] > > Only customers who lease numbers that support iMessage can use this endpoint. > [!WARNING] > > Phone numbers must be in E.164 format with country codes. > [!NOTE] > > Contiguity supports iCloud emails... but their behavior is unpredictable at times. ## Message formatting Format message text with markdown-style syntax. Supported styles: | Style | Syntax | | - | - | | **Bold** | `**text**` | | *Italics* | `_text_` or `*text*` | | ~~Strikethrough~~ | `~~text~~` | | **Underline** | `__text__` | | **~~*Combined*~~** | `**__~~_text_~~__**` | ![iMessage showing bold, italics, strikethrough, underline, and combined formatting styles.](https://mintcdn.com/contiguity/eD-IUqkMUEXsdF0d/images/imsg-format.jpg?fit=max\&auto=format\&n=eD-IUqkMUEXsdF0d\&q=85\&s=e37b1f72dcc8b3136b8cc7cb3b73d8eb) Example of formatted text in an iMessage conversation. ![](https://fake.img.com/nonexistent.jpg) # Start or Stop Typing Indicators Source: https://docs.contiguity.com/api-reference/product/imessage/typing openapi-send POST /imessage/typing Start or stop sending a typing indicator to an iMessage chat > [!NOTE] > > Contiguity supports iCloud emails... but their behavior is unpredictable at times. ![](https://fake.img.com/nonexistent.jpg) # Use Reverse OTP with iMessage Source: https://docs.contiguity.com/api-reference/product/imessage/verify openapi-send POST /not/a/route Have a user send you a text to verify their phone number Reverse OTP with iMessage verifies a user's phone number by having the user initiate a message to you over iMessage, rather than you reaching out first. Compared to traditional SMS OTPs, this workflow offers several advantages: * Sending an iMessage requires the user to use their own Apple device, making it much more difficult for attackers to fake and giving you greater confidence in the user's authenticity. * You save on operational costs because you’re not paying to have potentially dozens of lines to send outbound OTPs to users. * iMessage generally has high delivery and reliability rates, especially compared to international SMS, where texts may be blocked or filtered. * Ratelimits don't apply to inbound iMessage, so you can verify millions of users using just one iMessage-capable line. > [!NOTE] > > Reverse OTP with iMessage requires a leased iMessage-capable line, and an iMessage entitlement. > **[Implement Reverse OTP with iMessage](/api-reference/product/otp/reverse/initiate)** > > Read the API documentation for initiating, verifying, and cancelling a Reverse OTP with iMessage session. ![](https://fake.img.com/nonexistent.jpg) # Look up a phone number Source: https://docs.contiguity.com/api-reference/product/intelligence/lookup openapi-intelligence GET /{number} Carrier, CNAM, porting, and optional iMessage / FaceTime / risk data for an E.164 number > [!WARNING] > > Requires the `number_intelligence` entitlement. > [!NOTE] > > The path parameter must be an E.164 number. By default this returns carrier, CNAM, and porting data. `imessage` and `facetime` are `null` unless you set those query flags to `true`. The two flags are independent. `contiguity_risk_scoring_beta=true` requires **both** `imessage=true` and `facetime=true`. Otherwise the request fails with `400`. When risk scoring is returned, `imessage` and `facetime` are booleans (never `null`). | `contiguity_risk_scoring_beta.level` | score | | - | - | | `low` | `< 0.2` | | `medium` | `< 0.45` | | `high` | `< 0.7` | | `very_high` | otherwise | Score and confidence both range from `0.00` to `0.99`. Useful in conjunction with other fraud signals to determine if a user is risky. ![](https://fake.img.com/nonexistent.jpg) # Get call forwarding Source: https://docs.contiguity.com/api-reference/product/leases/call-forwarding openapi-numbers GET /lease/{number}/call_forwarding Get the current call forwarding on a leased number > [!NOTE] > > The path `number` must be a number you lease, in E.164. `call_forwarding.status` is `active` once the change is on the line. It is `queued` while the change is pending. `estimated_completion` is a millisecond timestamp while queued, and `null` once active. `to` is `null` when forwarding is disabled. ![](https://fake.img.com/nonexistent.jpg) # Disable call forwarding Source: https://docs.contiguity.com/api-reference/product/leases/call-forwarding-disable openapi-numbers POST /lease/{number}/call_forwarding/disable Stop forwarding calls on a leased number > [!NOTE] > > The path `number` must be a number you lease, in E.164. > [!TIP] > > Disabling can also queue. If `call_forwarding.status` is `queued`, wait for it to become `active` with `to` `null`. [Get call forwarding](/api-reference/product/leases/call-forwarding) to check. ![](https://fake.img.com/nonexistent.jpg) # Enable call forwarding Source: https://docs.contiguity.com/api-reference/product/leases/call-forwarding-enable openapi-numbers POST /lease/{number}/call_forwarding/enable Forward all calls to a leased number to another number > [!WARNING] > > `to` must be E.164. The path `number` must be a number you lease. > [!TIP] > > Enabling is not always instant. If `call_forwarding.status` is `queued`, the change is still pending. `estimated_completion` is when it should land. [Get call forwarding](/api-reference/product/leases/call-forwarding) until status is `active`. ![](https://fake.img.com/nonexistent.jpg) # Configure a number Source: https://docs.contiguity.com/api-reference/product/leases/configure openapi-numbers POST /{number}/configure Customize a leased number's behavior > [!TIP] > > The `failover` configuration lets you set up this number to act as a failover target.. > > * Set `enabled` to `true` to activate failover. > * The `mode` can be either `all` (any number can fail over) or `selective` (only specific numbers are allowed. Useful for multi-tenant failover setups). > * If you're using `selective` mode, provide the list of allowed leased numbers in `numbers`. ![](https://fake.img.com/nonexistent.jpg) # Number Details Source: https://docs.contiguity.com/api-reference/product/leases/details openapi-numbers GET /{number} Get details about a number, whether leased or available If the number is leased, Contiguity will return details about your lease – including the lease ID, status, and billing information. ![](https://fake.img.com/nonexistent.jpg) # Lease a number Source: https://docs.contiguity.com/api-reference/product/leases/lease openapi-numbers POST /lease/{number} Lease a specific phone number ![](https://fake.img.com/nonexistent.jpg) # Get all numbers you have leased Source: https://docs.contiguity.com/api-reference/product/leases/leased-all openapi-numbers GET /leased Get all phone numbers currently leased by the user ![](https://fake.img.com/nonexistent.jpg) # Available Leases Source: https://docs.contiguity.com/api-reference/product/leases/leases openapi-numbers GET /leases Get all numbers available for lease > [!NOTE] > > Searching by criteria (e.g. carrier, location, etc.) is not supported yet, but is planned. > [!WARNING] > > Contiguity only returns the leases you may be eligible for, rather than showing all available leases. If you need access to a broader selection of leases than what's currently visible to you, please reach out to us via email or Discord. ![](https://fake.img.com/nonexistent.jpg) # Terminate Lease Source: https://docs.contiguity.com/api-reference/product/leases/terminate openapi-numbers DELETE /leased/{number} Surrender your number to Contiguity > [!WARNING] > > This action is effective immediately. ![](https://fake.img.com/nonexistent.jpg) # Resend an OTP Source: https://docs.contiguity.com/api-reference/product/otp/resend openapi-otp POST /resend ![](https://fake.img.com/nonexistent.jpg) # Cancel a Reverse OTP session Source: https://docs.contiguity.com/api-reference/product/otp/reverse/cancel openapi-otp POST /reverse/cancel/{otp_id} ![](https://fake.img.com/nonexistent.jpg) # Initiate a Reverse OTP session Source: https://docs.contiguity.com/api-reference/product/otp/reverse/initiate openapi-otp POST /reverse/initiate ## What is a Reverse OTP? A reverse OTP verifies a user's phone number by having the user send a code to you via SMS or iMessage, rather than you sending it to them. This approach offers several key benefits compared to traditional OTPs: * Receiving SMS messages is easy and often free, so attackers may abuse online services to receive codes and bypass standard verification. * Sending an SMS, however, requires the user to use their own phone and carrier plan, making it more difficult to fake and providing greater confidence in the user's authenticity. * You save on operational costs, since you’re not paying to send SMS codes to your users. * Message delivery rates are often higher. Outbound SMS can be blocked, delayed, or filtered by carriers—especially for international users or high-volume senders. When users initiate the message themselves, it is much more likely to be delivered, as their carrier typically supports sending SMS to the US from anywhere in the world. > [!NOTE] > > Set `service` to `"sms"` or `"imessage"`. It defaults to `"sms"` when omitted. iMessage requires an active iMessage-capable leased number and an iMessage entitlement. [Learn more about Reverse OTP with iMessage](/api-reference/product/imessage/verify). ```javascript theme={null} const session = await contiguity.otp.reverse.initiate({ language: "en", service: "sms" }); ``` If you already know the phone number, in cases such as 2FA, pass `number` to require that exact sender for a successful verification: ```javascript theme={null} const session = await contiguity.otp.reverse.initiate({ number: "+15551234567", language: "en", service: "sms" }); ``` > [!TIP] > > **Streamline the experience with a QR code & button** > > Once you've initiated a reverse OTP session, Contiguity provides a payload that you can turn into a QR code. Display this QR code to your user, who can then scan it with their phone to automatically populate the phone number and body fields. > > Use `session.ui.qr_code`. Do not hardcode an `sms:` URL. > > ```javascript theme={null} > await generateQRCode(session.ui.qr_code); > ``` > > ![](data:image/gif;base64,R0lGODdhUgBSAIAAAAAAAP///ywAAAAAUgBSAAAC/4yPqcvtD6OctNqLs968+w+G4kiW5mkC6sqyRtsiqrwqbgDnAKXDb0+jzRK3XmwyZAx9uOMveWBCbTtkVVmVOptTbq3p6Iazx24xNz4/v+LGsnyNstFu+PrNI6u9N2G87/VzR5Y3KMj35acoh4d4KPG2x7SG1WhpZ2UI5sgYt3ip2YY1dmhU6bkpugmJGpQKtABY2iqXZwT6Oqv7ekt7apobjHvZm/JH+DCJEgHVmJa43Hz8mAzrF+nLPF27Wq1DdaYKvn0N7UrZjS5tS94py62OukddyBnvHJhfvmiBLY1NLZy8Le9Ynes06Fs6InPoVVjH0B8sVZKyjVooEd/Fi///LDJ0mBEZqToBzXmbA3EfLz3HzGyBoCWlO2QC+c3sZxJQzF4iu2m04rJjSIUyf8IcOJRWRYezCpKMyFLZJ5pKo3qkMq6kFldB4Yh7OrUcvp9ETeIcRxalVVZfR6rses9sLLlsee5KilXfQnbFhFl9BxCetnk+2ylzeRDDVsFFCQ5M/EEiWkzxuPbUIBnq4srcjD7MaRh0wnboFItmfFohSLpzIQrUKTdz4LYIO6uF3UY2S6YnLb9+uVJqZGi6Vds27sE1aMKjeTb87Bvpc7HOp48g7LRkXuHJrWcvvB34M2Bu8ynfhdlutbC20Weg2JKqTeTgoYM13xM3cJkGOQlqVbvRTIBddZx3dDjVlXC0NfVcYO4Bw9xeTy3mYDDN7YYRgQyO9VhtHU3mGUeUZcheaQJett597k3Fn15nqWghVCbC9Z56M2KoXGMLnngYcThuA5tNywxJZJFGHolkkkouyWSTTj4JpQEFAAA7) > > Result > > **Add a button or anchor tag to your UI** > > Obviously, a QR code to someone on a phone is pretty useless. But, the `qr_code` payload can also be placed into a button or anchor tag's `href` attribute, which will automatically open the user's messaging app with the phone number and body fields populated! > > ```html theme={null} > > Tap to Verify >