Zendesk Sessions API

The Zendesk Sessions API lets you audit and control users active sign-in sessions in your Zendesk account. It provides endpoints to list current sessions (for the authenticated user or a specified user) and returns metadata such as device/user agent, IP, creation time, and last activity. You can revoke an individual session or all sessions for a user to force logouts across Zendesk web and mobile experiencesuseful for security incidents, offboarding, and SSO changes.

OpenAPI Specification

sessions-openapi-original.yml Raw ↑
openapi: 3.1.0
info:
  version: "1.0"
  title: Zendesk Sessions
  description: Needs a description.
paths:
  /api/v2/sessions:
    parameters:
      - $ref: '#/components/parameters/UserId'
    get:
      operationId: ListSessions
      tags:
        - Sessions
      summary: Zendesk Get  Api V2 Sessions
      description: >
        If authenticated as an admin, returns all the account's sessions. If
        authenticated as an agent or end user, returns only the sessions of the
        user making the request.


        #### Pagination


        - Cursor pagination (recommended)

        - Offset pagination


        See [Pagination](/api-reference/introduction/pagination/).


        #### Allowed For


        * Admins, Agents, End users
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionsResponse'
              examples:
                default:
                  $ref: '#/components/examples/SessionsResponseExample'
  /api/v2/users/{user_id}/sessions:
    parameters:
      - $ref: '#/components/parameters/UserId'
    delete:
      operationId: BulkDeleteSessionsByUserId
      tags:
        - Sessions
      summary: Zendesk Delete  Api V2 Users User_id Sessions
      description: |
        Deletes all the sessions for a user.

        #### Allowed For

        * Admins, Agents, End users
      responses:
        '204':
          description: No Content
  /api/v2/users/{user_id}/sessions/{session_id}:
    parameters:
      - $ref: '#/components/parameters/SessionId'
      - $ref: '#/components/parameters/UserId'
    get:
      operationId: ShowSession
      tags:
        - Sessions
      summary: Zendesk Get  Api V2 Users User_id Sessions Session_id
      description: |
        #### Allowed For

        * Admins, Agents, End users
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResponse'
              examples:
                default:
                  $ref: '#/components/examples/SessionResponseExample'
    delete:
      operationId: DeleteSession
      tags:
        - Sessions
      summary: Zendesk Delete  Api V2 Users User_id Sessions Session_id
      description: |
        #### Allowed For

        * Admins, Agents, End users
      responses:
        '204':
          description: No Content
components:
  schemas:
    SessionsResponse:
      type: object
      properties:
        sessions:
          type: array
          items:
            $ref: '#/components/schemas/SessionObject'
    SessionResponse:
      type: object
      properties:
        session:
          type: array
          items:
            $ref: '#/components/schemas/SessionObject'
tags:
  - name: Sessions