Salesforce Service Cloud Sessions API

Chat session lifecycle management

Operations 3

GET /System/SessionId Salesforce Service Cloud Get a new session ID #
POST /Chasitor/ChasitorInit Salesforce Service Cloud Initiate a chat session #
POST /Chasitor/ChatEnd Salesforce Service Cloud End a chat session #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/salesforce-service-cloud-sessions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

salesforce-service-cloud-sessions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Salesforce Service Cloud Salesforce Chat REST Sessions API
  description: REST API for managing live chat sessions between agents and visitors in Salesforce Service Cloud. Enables initiating chat sessions, sending and receiving messages, and monitoring chat activity.
  version: '59.0'
  contact:
    name: Salesforce Developer Support
    url: https://developer.salesforce.com/support
  termsOfService: https://www.salesforce.com/company/legal/agreements/
servers:
- url: https://{hostname}/chat/rest
  description: Chat REST API Endpoint
  variables:
    hostname:
      default: d.la1-c1-ia4.salesforceliveagent.com
      description: Your Live Agent endpoint hostname
security:
- apiKey: []
tags:
- name: Sessions
  description: Chat session lifecycle management
paths:
  /System/SessionId:
    get:
      operationId: getSessionId
      summary: Salesforce Service Cloud Get a new session ID
      description: Generates a unique session ID and key to establish a new chat session. This must be the first request made for every new chat.
      tags:
      - Sessions
      parameters:
      - $ref: '#/components/parameters/AffinityToken'
      responses:
        '200':
          description: Session ID and key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionIdResponse'
        '403':
          description: Invalid API version or configuration
  /Chasitor/ChasitorInit:
    post:
      operationId: initiateChatSession
      summary: Salesforce Service Cloud Initiate a chat session
      description: Initiates a new chat request from a visitor, placing them in the queue for an available agent.
      tags:
      - Sessions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChasitorInit'
      responses:
        '200':
          description: Chat session initiated
        '400':
          description: Invalid request parameters
        '503':
          description: No agents available
  /Chasitor/ChatEnd:
    post:
      operationId: endChat
      summary: Salesforce Service Cloud End a chat session
      description: Ends the current chat session from the visitor side.
      tags:
      - Sessions
      responses:
        '200':
          description: Chat ended successfully
        '403':
          description: Invalid session
components:
  schemas:
    ChasitorInit:
      type: object
      required:
      - organizationId
      - deploymentId
      - buttonId
      - sessionId
      - visitorName
      properties:
        organizationId:
          type: string
          description: Salesforce organization ID
        deploymentId:
          type: string
          description: Chat deployment ID
        buttonId:
          type: string
          description: Chat button ID
        sessionId:
          type: string
          description: Session ID from SessionId request
        visitorName:
          type: string
          description: Display name of the visitor
        prechatDetails:
          type: array
          items:
            type: object
          description: Pre-chat form field values
    SessionIdResponse:
      type: object
      properties:
        id:
          type: string
          description: The unique session ID
        key:
          type: string
          description: The session key for subsequent requests
        affinityToken:
          type: string
          description: Token for maintaining session affinity
        clientPollTimeout:
          type: integer
          description: Recommended polling interval in seconds
  parameters:
    AffinityToken:
      name: X-LIVEAGENT-AFFINITY
      in: header
      required: true
      description: Affinity token for session routing
      schema:
        type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-LIVEAGENT-API-VERSION
      description: Live Agent API version header
externalDocs:
  description: Chat REST API Developer Guide
  url: https://developer.salesforce.com/docs/atlas.en-us.live_agent_rest.meta/live_agent_rest/