## Create a verification **post** `/api/v2/verify/services/{service_sid}/verifications` Creates an inverted-OTP verification for the supplied E.164 phone number. The user must send the returned code from that exact phone number to the returned Sendblue destination number. Include `hosted` to create an origin-bound Hosted Verify widget session. Sendblue API credentials must remain on the customer's backend; only the returned `hosted` values may be sent to the browser. Twilio-compatible clients may alternatively send the API Key ID and API Secret Key with HTTP Basic authentication. Temporary bearer authentication is supported for account-scoped tokens; line-scoped temporary tokens cannot create account-wide Verifications. ### Path Parameters - `service_sid: string` ### Body Parameters - `to: string` E.164 phone number that must send the verification message. - `hosted: optional object { parent_origin, accent_color, brand_name, theme }` Options for an origin-bound Hosted Verify widget session. Nested keys are strict snake_case. `parent_origin` must be an exact HTTPS origin with a DNS hostname. `127.0.0.1` is also accepted, and HTTP is allowed only for `localhost` or `127.0.0.1` development origins. Wildcards and other IP literals are rejected because browsers cannot enforce them as exact CSP `frame-ancestors` sources. - `parent_origin: string` Exact website origin allowed to embed the widget, with no path, query, or fragment. - `accent_color: optional string` Six-digit hexadecimal accent color. - `brand_name: optional string` Brand name displayed by the widget. Defaults to Sendblue. - `theme: optional "light" or "dark" or "auto"` - `"light"` - `"dark"` - `"auto"` ### Returns - `account_sid: string` - `channel: "imessage"` - `"imessage"` - `date_created: string` - `date_updated: string` - `expires_at: string` ISO timestamp when the Verification expires. - `service_sid: string` - `sid: string` - `status: "pending" or "approved" or "expired" or "canceled"` - `"pending"` - `"approved"` - `"expired"` - `"canceled"` - `to: string` Expected sender in E.164 format; older durable terminal records may return null. - `url: string` - `delivery_target: optional DeliveryTarget` Present while the Verification is pending. - `code: string` Code the expected sender must text to `pool_number`. - `pool_number: string` Sendblue phone number that should receive the verification code. - `sms_deep_link: string` Messages/SMS deep link with the destination and code prefilled. - `hosted: optional HostedVerification` Present only when hosted options were supplied during creation. - `component_script: string` Web-component script URL. Load this value exactly as returned. - `expires_at: string` ISO timestamp when the Verification expires. - `session_id: string` Hosted widget session identifier. - `url: string` Origin-bound widget URL containing a one-session bearer token in its fragment. Do not log, persist, or move the token into a query parameter. ### Example ```http curl https://api.sendblue.co/api/v2/verify/services/$SERVICE_SID/verifications \ -H 'Content-Type: application/json' \ -H "sb-api-key-id: $SENDBLUE_API_API_KEY" \ -H "sb-api-secret-key: $SENDBLUE_API_API_SECRET" \ -d '{ "to": "+14155551212" }' ``` #### Response ```json { "account_sid": "account_sid", "channel": "imessage", "date_created": "2019-12-27T18:11:19.117Z", "date_updated": "2019-12-27T18:11:19.117Z", "expires_at": "2019-12-27T18:11:19.117Z", "service_sid": "SVE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD", "sid": "VRE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD", "status": "pending", "to": "+14155551212", "url": "https://example.com", "delivery_target": { "code": "CB6DJ9", "pool_number": "+17865640246", "sms_deep_link": "sms:+17865640246?body=CB6DJ9" }, "hosted": { "component_script": "https://api.sendblue.co/api/v2/verify/widget.js", "expires_at": "2019-12-27T18:11:19.117Z", "session_id": "session_id", "url": "https://api.sendblue.co/api/v2/verify/widget?session=abc123#token=secret" } } ```