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

# Delete AI session

> Deletes an AI session created through the Box public API, together with its agent tasks. The session's agent-generated files and uploaded files are moved to the trash. Files attached as sources from elsewhere in Box are not affected. Deleting a session does not stop a running task or notify the agent.

The access token must have both the `ai.readwrite` and `root_readwrite` scopes.

> [!NOTE]
>
> Learn more about [Box SDK versioning strategy](https://developer.box.com/guides/tooling/sdks/sdk-versioning.md).


## OpenAPI

````yaml box-openapi-v2026.0.json DELETE /ai_sessions/{ai_session_id}
openapi: 3.0.2
info:
  title: Box Platform API
  description: >-
    [Box Platform](https://developer.box.com) provides functionality to provide
    access to content stored within [Box](https://box.com). It provides
    endpoints for basic manipulation of files and folders, management of users
    within an enterprise, as well as more complex topics such as legal holds and
    retention policies.
  termsOfService: https://cloud.app.box.com/s/rmwxu64h1ipr41u49w3bbuvbsa29wku9
  contact:
    name: Box, Inc
    url: https://developer.box.com
    email: devrel@box.com
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: '2026.0'
  x-box-commit-hash: d3324c11ac
servers:
  - url: https://api.box.com/2.0
    description: Box Platform API server.
security:
  - OAuth2Security: []
tags:
  - name: AI Sessions
    description: >-
      Endpoints for listing and deleting AI sessions, which hold the
      conversation state for interactions with Box AI agents.
    x-box-tag: ai_sessions
  - name: Automate Workflows
    description: Endpoints for listing and manually starting Automate workflow actions.
    x-box-tag: automate_workflows
  - name: Convert to Box Note
    description: Create Box Notes from supported source content (for example Markdown).
    x-box-tag: notes
  - name: Document Split
    description: >-
      A set of endpoints used to split a paginated source document into multiple
      files based on user-defined or AI-generated page ranges.
    x-box-tag: document_split
  - name: Query
    description: Query for your items.
    x-box-tag: query
  - name: Shuttle
    description: >-
      Endpoints for managing Box Shuttle, the service that migrates content into
      Box from external sources. Use these endpoints to manage the systems that
      Shuttle migrates content from and the migration jobs that Shuttle runs.
    x-box-tag: shuttle
externalDocs:
  description: Box Developer Documentation.
  url: https://developer.box.com
paths:
  /ai_sessions/{ai_session_id}:
    delete:
      tags:
        - AI Sessions
      summary: Delete AI session
      description: >-
        Deletes an AI session created through the Box public API, together with
        its agent tasks. The session's agent-generated files and uploaded files
        are moved to the trash. Files attached as sources from elsewhere in Box
        are not affected. Deleting a session does not stop a running task or
        notify the agent.


        The access token must have both the `ai.readwrite` and `root_readwrite`
        scopes.
      operationId: delete_ai_sessions_id_v2026.0
      parameters:
        - $ref: '#/components/parameters/BoxVersionHeader'
        - name: ai_session_id
          in: path
          description: >-
            The unique identifier of the AI session. This is the same value
            returned as `id` by the list endpoint and used as the A2A
            `contextId`.
          required: true
          schema:
            type: string
          example: '23489723'
      responses:
        '204':
          description: >-
            Returns an empty response when the AI session was successfully
            deleted.
        '400':
          description: >-
            Returned with the `bad_request` code when `ai_session_id` is empty
            or malformed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '401':
          description: >-
            Returned when the access token provided in the `Authorization`
            header is not recognized or not provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '403':
          description: >-
            Returned with the `insufficient_scope` code when the access token
            does not have both the `ai.readwrite` and `root_readwrite` scopes,
            or with the `forbidden` code when the user can read the AI session
            but is not permitted to delete it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: >-
            Returned with the `not_found` code when the AI session does not
            exist, is not visible to the user, was not created through the Box
            public API, or was already deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '429':
          description: >-
            Returned with the `too_many_requests` code when the user has sent
            too many requests in a given amount of time.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        default:
          description: An unexpected client error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
components:
  parameters:
    BoxVersionHeader:
      name: box-version
      in: header
      description: Version header.
      allowEmptyValue: false
      required: true
      schema:
        type: string
        enum:
          - '2026.0'
      example: '2026.0'
  schemas:
    ClientError:
      description: A generic error.
      type: object
      properties:
        type:
          description: The value will always be `error`.
          type: string
          example: error
          enum:
            - error
          nullable: false
        status:
          description: The HTTP status of the response.
          type: integer
          format: int32
          example: 400
          nullable: false
        code:
          description: A Box-specific error code.
          type: string
          example: item_name_invalid
          enum:
            - created
            - accepted
            - no_content
            - redirect
            - not_modified
            - bad_request
            - unauthorized
            - forbidden
            - not_found
            - method_not_allowed
            - conflict
            - precondition_failed
            - too_many_requests
            - internal_server_error
            - unavailable
            - item_name_invalid
            - insufficient_scope
        message:
          description: A short message describing the error.
          type: string
          example: Method Not Allowed
          nullable: false
        context_info:
          description: >-
            A free-form object that contains additional context about the error.
            The possible fields are defined on a per-endpoint basis. `message`
            is only one example.
          type: object
          example:
            message: Something went wrong
          additionalProperties: {}
          nullable: true
        help_url:
          description: A URL that links to more information about why this error occurred.
          type: string
          example: >-
            https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/
          nullable: false
        request_id:
          description: >-
            A unique identifier for this response, which can be used when
            contacting Box support.
          type: string
          example: abcdef123456
          nullable: false
      title: Client error
      x-box-resource-id: client_error_v2026.0
  securitySchemes:
    OAuth2Security:
      type: oauth2
      description: >-
        The access token received from the authorization server in the OAuth 2.0
        flow.
      flows:
        authorizationCode:
          authorizationUrl: https://account.box.com/api/oauth2/authorize
          tokenUrl: https://api.box.com/oauth2/token
          scopes:
            root_readonly: Read all files and folders stored in Box
            root_readwrite: Read and write all files and folders stored in Box
            manage_app_users: Provision and manage app users
            manage_managed_users: Provision and manage managed users
            manage_groups: Manage an enterprise's groups
            manage_webhook: Create webhooks programmatically through the API
            manage_enterprise_properties: Manage enterprise properties
            manage_data_retention: Manage data retention polices
            manage_legal_hold: Manage Legal Holds

````