---
sourceDocument: Brazil API Reference
sourceDocumentLink: https://www.servicenow.com/docs/r/api-reference

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Cookie Auth API

# Cookie Auth API {#ariaid-title1}

Release version: Brazil  
Updated October 14, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read  
The Cookie Auth Scripted REST API provides an endpoint that creates a short-lived ticket that the WebRTC phone widget needs to start a voice call. Because this endpoint doesn't require a login, it works for
authenticated and unauthenticated users.

WebRTC voice calling is a core capability for Customer Service Management (CSM) portals and Engagement Messenger. The Cookie Auth API allows authenticated and unauthenticated users (like customers on public support portals, third parties embedding Engagement Messenger) start a voice call
without logging in. The ticket expires after 60 seconds and works once, so a caller never gets a long-lived credential. The API imposes rate limits so the open endpoint can't be hit without restriction (see the API rate limits section for more information).

Typically, customers won't call this API directly because the phone widget calls it automatically when someone starts a call.

## Access and authentication {#cookieauth-api__section_access_authentication}

This API is provided in the sn_webrtc scope and requires the com.sn_webrtc (WebRTC Voice) plugin. No role is required to access this API.

## API rate limits {#cookieauth-api__section_rate_limits}

The application ships with two rate limit rules for the Cookie Auth POST endpoint. You can change the limits to suit your environment.
{#cookieauth-api__table_p5x_gjc_xkc__entry__3}

| Rule name | Applies to | Limit |
|-|-|-|
| WebRTC cookie auth limit for all users | All users | 3,600 requests per hour |
| WebRTC cookie auth limit for un-authenticated users | The Guest user | 3,600 requests per hour |
[Table 1. Shipped rate limit rules]

{#cookieauth-api__table_p5x_gjc_xkc}  
Important:  
All unauthenticated callers share the single Guest user identity, so the limit for the Guest rule is a shared limit for all unauthenticated callers, not a limit for each caller.

Conversely, authenticated users each
get 3,600 requests per hour as it is not shared under one identity. For example, authenticated User 1 gets 3,600 requests per hour, User 2 gets 3,600 per hour, and so on.

## Cookie Auth - POST /api/sn_webrtc/webrtc_cookie_auth/cookie_auth {#ariaid-title2}

Returns a short-lived ticket that the WebRTC phone widget uses to connect to the voice service and start a call. The endpoint doesn't require login, so guest users can place calls.

### URL format

Default URL: /api/sn_webrtc/webrtc_cookie_auth/cookie_auth

### Trusted orchestrator domains {#cookieauth-POST-cookie_auth__section_trusted_domains}

The Cookie Auth POST endpoint creates a ticket only when the orchestrator_host value matches a domain in the following system property, or is a subdomain of one of those domains. If the
property is empty, the endpoint uses the default domain, sncapps.service-now.com.
{#cookieauth-POST-cookie_auth__table_pvx_gjc_xkc__entry__3}

| Property | Description | Default value |
|-|-|-|
| sn_webrtc.orchestrator.trusted_domains | Comma-separated list of trusted domains. A host is trusted when it equals one of the domains or is a subdomain of one of them. Only users with the maint role can change this property. Data type: String | sncapps.service-now.com |
[Table 2. Trusted domains system property]

{#cookieauth-POST-cookie_auth__table_pvx_gjc_xkc}

### Supported request parameters

{#cookieauth-POST-cookie_auth__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 3. Path parameters]

{#cookieauth-POST-cookie_auth__entry__12}

| Name | Description |
|-|-|
| None |   |
[Table 4. Query parameters]

{#cookieauth-POST-cookie_auth__entry__17}

| Name | Required | Description |
|-|-|-|
| voice_service_id | Required | The sys_id of the voice service configuration. The value must pass the platform sys_id check and must also be exactly 32 lowercase hexadecimal characters. Data type: String Format: 32 lowercase hexadecimal characters Maximum length: 256 |
| orchestrator_host | Required | The host name of the voice orchestrator, as a bare host name or an https:// URL. The endpoint rejects http:// URLs and values that include a port, path, query string, or credentials. The host must match a trusted domain exactly or be a subdomain of a trusted domain. For information about trusted domains, see the Trusted orchestrator domains section. Data type: String Maximum length: 256 |
| instance_name | Required | ServiceNow instance identifier. Format: `[a-z0-9][a-z0-9-]{0,62}` (max 63 characters) Data type: String |
[Table 5. Request body parameters (JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/TSHwMH5MZNTdV2wXSUhSiw "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cookieauth-POST-cookie_auth__entry__28}{#cookieauth-POST-cookie_auth__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the request body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Required. Must be application/json. The endpoint rejects any other content type with a 400 status code. |
| X-UserToken | Required. The session CSRF token for the current session. The endpoint rejects requests with a missing or incorrect token. |
[Table 6. Request headers]

{#cookieauth-POST-cookie_auth__entry__36}

| Header | Description |
|-|-|
| None |   |
[Table 7. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/TSHwMH5MZNTdV2wXSUhSiw "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").  
Note:  
See the 'API rate limits' section [Cookie Auth API](https://www.servicenow.com/docs/xlFLuq83CtUhN_DcG8cd~w#cookieauth-api "The Cookie Auth Scripted REST API provides an endpoint that creates a short-lived ticket that the WebRTC phone widget needs to start a voice call. Because this endpoint doesn’t require a login, it works for authenticated and unauthenticated users.") for issues around rate limiting.
{#cookieauth-POST-cookie_auth__entry__40}{#cookieauth-POST-cookie_auth__entry-200-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. The request wasn't valid. Possible causes include a missing or invalid parameter, a content type other than application/json, a request body larger than 2,048 bytes, or an orchestrator host that isn't trusted. The response doesn't identify which check failed due to a security constraint. Response body: `{"error": "Bad Request"}` |
| 502 | Bad Gateway. The instance couldn't get a ticket from the voice orchestrator. Response body: `{"error": "Bad Gateway"}` |
[Table 8. Status codes]

### Response body parameters (JSON)

{#cookieauth-POST-cookie_auth__entry__48}

| Name | Description |
|-|-|
| ws_ticket | Ticket that the client uses to open the WebSocket connection to the voice orchestrator. The ticket expires after 60 seconds and can be used only once. Data type: String |
[Table 9. Response body parameters]

### cURL request

The following example demonstrates how to use the POST endpoint to request a ticket for a voice service. The request includes the session CSRF token header.

    curl "https://instance.service-now.com/api/sn_webrtc/webrtc_cookie_auth/cookie_auth" \
            --request POST \
            --header "Accept: application/json" \
            --header "Content-Type: application/json" \
            --header "X-UserToken: session_csrf_token" \
            --data "{\"voice_service_id\": \"0123456789abcdef0123456789abcdef\", \"orchestrator_host\": \"https://myservicenoworchestrator.sncapps.service-now.com\"}"

Response body. The response contains the ticket.

    {
            "ws_ticket": "ticket_value"
            }


