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

# Rename session

> Rename a session. `name` is the only mutable field; it is trimmed and must be between 1 and 256 characters after trimming.

Returns the full session, in the same shape as Retrieve session.




## OpenAPI

````yaml patch /sessions/{session_id}
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.gumloop.com/api/v1
security: []
paths:
  /sessions/{session_id}:
    patch:
      tags:
        - Sessions
      summary: Rename session
      description: >
        Rename a session. `name` is the only mutable field; it is trimmed and
        must be between 1 and 256 characters after trimming.


        Returns the full session, in the same shape as Retrieve session.
      operationId: renameSession
      parameters:
        - in: path
          name: session_id
          required: true
          schema:
            type: string
          description: ID of the session to rename.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - name
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 256
                  description: >-
                    New name for the session. Leading and trailing whitespace is
                    removed before the 1-256 character limit is applied, so a
                    whitespace-only value is rejected.
                  example: Acme Corp research
      responses:
        '200':
          description: The renamed session.
          content:
            application/json:
              schema:
                type: object
                properties:
                  session:
                    type: object
                    properties:
                      id:
                        type: string
                        example: sess_xYz789AbCd
                      agent_id:
                        type: string
                        example: abc123DEFghiJKL
                      name:
                        type: string
                        example: Acme Corp research
                      state:
                        type: string
                        enum:
                          - idle
                          - queued
                          - processing
                          - approval_required
                          - completed
                          - failed
                        example: completed
                    description: Full session object; see Retrieve session for every field.
                  queue_position:
                    type: integer
                    nullable: true
                    example: null
              example:
                session:
                  id: sess_xYz789AbCd
                  agent_id: abc123DEFghiJKL
                  name: Acme Corp research
                  state: completed
                queue_position: null
        '400':
          description: >-
            Invalid request body — `name` is missing, empty, longer than 256
            characters, or the body contains unknown fields.
        '401':
          description: Unauthorized — missing or invalid API key.
        '403':
          description: Forbidden — the caller does not have update access on the session.
        '404':
          description: Session not found.
        '500':
          description: Internal server error.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl -X PATCH
            'https://api.gumloop.com/api/v1/sessions/sess_xYz789AbCd' \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
              -H 'Content-Type: application/json' \
              -d '{"name": "Acme Corp research"}'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal API key or an [OAuth 2.0](/api-reference/oauth) access token.
        Personal API keys also require the `x-auth-key` header with your user
        ID.

````