> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kayle.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel a session



## OpenAPI

````yaml /api-reference/openapi.json post /v1/sessions/{id}/cancel
openapi: 3.1.0
info:
  title: Kayle ID
  version: 1.5.0
  description: Privacy-first identity verification.
  license:
    name: Apache License 2.0
    url: https://github.com/kayleai/kayle-id/blob/main/LICENSE
  contact:
    name: Kayle ID
    url: https://kayle.id
    email: help@kayle.id
  termsOfService: https://kayle.id/terms
servers:
  - url: http://127.0.0.1:8787
    description: ''
security:
  - bearerAuth: []
paths:
  /v1/sessions/{id}/cancel:
    post:
      tags:
        - Sessions
      summary: Cancel a session
      parameters:
        - schema:
            type: string
            pattern: ^vs_[A-Za-z0-9]{64}$
            description: The ID of the verification session to cancel (e.g. vs_...).
          required: true
          description: The ID of the verification session to cancel (e.g. vs_...).
          name: id
          in: path
      responses:
        '204':
          description: Session cancelled.
        '404':
          description: Session not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: 'null'
                    description: Empty data object.
                  error:
                    type:
                      - object
                      - 'null'
                    properties:
                      code:
                        type: string
                        description: The error code
                      message:
                        type: string
                        description: The error message
                      hint:
                        type: string
                        description: A hint to help the user fix the error
                      docs:
                        type: string
                        description: A link to the documentation for the error
                    required:
                      - code
                      - message
                      - hint
                      - docs
                required:
                  - data
                  - error
                example:
                  data: null
                  error:
                    code: NOT_FOUND
                    message: Session not found.
                    hint: The session with the given ID was not found.
                    docs: https://kayle.id/docs/api/sessions#cancel-by-id
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: 'null'
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - INTERNAL_SERVER_ERROR
                      message:
                        type: string
                        enum:
                          - Internal server error.
                      hint:
                        type: string
                        enum:
                          - The server encountered an error.
                      docs:
                        type: string
                        enum:
                          - https://kayle.id/docs/api/errors
                    required:
                      - code
                      - message
                      - hint
                      - docs
                required:
                  - data
                  - error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````