---
schema_version: "1"
id: 1de8d713af1fafe0857287ceb61df01db6618f1201626abfda916734cd1452e6
title: Enhanced Chat Configuration API Endpoints
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-api/references/generated-api-specs/miaw-api-reference-esw.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-api/references/miaw-api-reference-esw
source_site: developer.salesforce.com
content_type: documentation
content_hash: f14d9fdbd21b893ece284b355fdb65db8d40b64733dbae408c766959e71f0252
products:
  - Enhanced Chat API
  - Service Cloud Developer Content
---
Enhanced Chat Configuration API Endpoints

# Enhanced Chat Configuration API Endpoints

Public REST API for Enhanced Chat Configuration

**Version:** 2.0.0

## Servers

*   `https://{scrt-url}`
    *   ``scrt-url (default mycompanyname.salesforce-scrt.com) In the URI, set `{scrt-url}` to the URL in the Enhanced Chat custom client Embedded Service deployment code snippet. For example, `https://mycompanyname.salesforce-scrt.com`.``

## Operations

### GET Determines whether service reps are available to accept new chats based on the criteria specified in the channel settings.

`GET /embeddedservice/v2/agent-availability`

Operation ID: `getAgentAvailability`. Tags: agentAvailabilityV2.

Before you use this endpoint, an admin must enable Chat Button visibility in Setup. See [Control Chat Button Visibility in Enhanced Chat](https://help.salesforce.com/s/articleView?language=en_US&id=service.miaw_chat_button_visibility.htm&type=5) for more information.

Salesforce uses the routing type setting to determine whether to check the primary or fallback queue for agent availability:

*   If routing is queue-based (Routing Type is **Omni-Queue**), Salesforce checks the Queue for agent availability.
*   If routing is based on an Omni-Channel flow (Routing Type is **Omni-Flow**), Salesforce checks the fallback queue for agent availability.
*   If routing is directed to an Agentforce Service Agent (Routing Type is **Agentforce Service Agent**), Salesforce checks the fallback queue for agent availability.

#### Parameters

*   `orgId` (query, string, required) The 15-character org ID of the Salesforce org where Enhanced Chat is set up.
*   `esConfigName` (query, string, required)
    
    The API name of the Enhanced Chat Embedded Service deployment. The name can contain alphanumeric characters and underscores, and must begin with a letter. The deployment type that's associated with the `esDeveloperName` deployment must match the `deploymentType` in the access token.
    
    Verify that the Embedded Service deployment is configured to support the request.
    
    *   The deployment type for the Embedded Service deployment must be set to Custom Client. If properly configured, after you send the request, `deploymentType` in the response will be set to `api`. If `deploymentType` isn't set to `api`, create an Embedded Service deployment or use another deployment with deployment type set to Custom Client. See [Configure a Custom Client Deployment for Enhanced Chat](https://help.salesforce.com/s/articleView?id=sf.miaw_deployment_custom.htm) for more information.

#### Responses

*   **200** Successful Request
    
    Media type: `application/json`. Schema: `AgentAvailabilityResponse`.
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: invalidConfigName_ Invalid Embedded Service configuration name
    
    ```
    {
      "success": false,
      "error": {
        "errorCode": "BAD_REQUEST",
        "message": "The Embedded Service configuration name is invalid."
      }
    }
    ```
    
    _Example: missingOrgId_ Missing organization ID
    
    ```
    {
      "success": false,
      "error": {
        "errorCode": "BAD_REQUEST",
        "message": "Specify a valid organization ID."
      }
    }
    ```
    
    _Example: invalidOrgId_ Invalid or deleted organization
    
    ```
    {
      "success": false,
      "error": {
        "errorCode": "BAD_REQUEST",
        "message": "The organization ID is invalid or the organization was deleted."
      }
    }
    ```
    
    _Example: edgeNotEnabled_ Edge not enabled for the organization
    
    ```
    {
      "success": false,
      "error": {
        "errorCode": "BAD_REQUEST",
        "message": "To check agent availability, enable Edge for your organization."
      }
    }
    ```
    
    _Example: unsupportedDeploymentType_ Deployment type not supported
    
    ```
    {
      "success": false,
      "error": {
        "errorCode": "BAD_REQUEST",
        "message": "Agent availability API is not supported for this deployment type."
      }
    }
    ```
    
    _Example: invalidParameters_ Invalid request parameters
    
    ```
    {
      "success": false,
      "error": {
        "errorCode": "INVALID_INPUT",
        "message": "The request contains invalid parameters. Check the request and try again."
      }
    }
    ```
    
*   **401** Unauthenticated Request
*   **403** Unauthorized Request
*   **404** Not Found
*   **410** Gone
    
    Media type: `application/json`. Schema: `Error`.
    
*   **422** Unprocessable Entity (Setup Errors)
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: chatButtonVisibilityDisabled_ Chat Button Visibility setting turned off
    
    ```
    {
      "success": false,
      "error": {
        "errorCode": "SETUP_ERROR",
        "message": "To check agent availability, you must turn on the Chat Button Visibility setting in your Messaging channel settings."
      }
    }
    ```
    
    _Example: queueNotConfigured_ Queue not configured
    
    ```
    {
      "success": false,
      "error": {
        "errorCode": "SETUP_ERROR",
        "message": "You haven't configured a queue in your Messaging channel settings."
      }
    }
    ```
    
*   **429**
    
    Too Many Requests.
    
    **Recommendation:** If you receive a 429 response, don't use fixed-interval polling. Instead, implement exponential backoff with jitter to avoid further rate limiting.
    
*   **500** Internal Server Error
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: internalError_ Internal server error
    
    ```
    {
      "success": false,
      "error": {
        "errorCode": "INTERNAL_ERROR",
        "message": "An internal error occurred. Contact Salesforce Customer Support."
      }
    }
    ```
    
*   **503** Service Unavailable
*   **504** Gateway Timeout

## Schemas

### AgentAvailabilityResponse

*   `success` (_boolean_, required) Indicates whether the request was successful.  
    Example: `true`.
*   `response` (_AgentAvailabilityResponseBody_)

### Error

*   `success` (_boolean_, required) Indicates whether the request was successful.  
    Example: `false`.
*   `error` (_ErrorCode_, required)

### AgentAvailabilityResponseBody

*   `agentAvailable` (_boolean_, required) Indicates whether an agent is available.  
    Example: `false`.

### ErrorCode

*   `errorCode` (_ResponseErrorCode_, required) Error code if an error occurred.
*   `message` (_string_, required) Brief description of the error.  
    Example: `The org ID is invalid or doesn't exist.`.

### ResponseErrorCode

Response error code.

Type: `string`.

Allowed values: `BAD_REQUEST`, `FORBIDDEN`, `INVALID_INPUT`, `SETUP_ERROR`, `INTERNAL_ERROR`, `RATE_LIMITED`, `UNKNOWN_ERROR`. Default: `UNKNOWN_ERROR`.