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

# Update session

> Update the label of an Agent Vault session



## OpenAPI

````yaml PATCH /api/v1/agent-vault/sessions/{sessionId}
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v1/agent-vault/sessions/{sessionId}:
    patch:
      tags:
        - Agent Vault Sessions
      description: Update the label of an Agent Vault session
      operationId: updateAgentVaultSession
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: sessionId
          required: true
          description: The ID of the session.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type: string
                  maxLength: 128
                  nullable: true
                  description: >-
                    The new label for the session, up to 128 characters, without
                    line breaks, tabs, or invisible characters. Send null or an
                    empty string to remove the label. You can't change the label
                    once the session's owner is deleted.
              required:
                - label
              additionalProperties: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  session:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: The ID of the session.
                      label:
                        type: string
                        nullable: true
                        description: >-
                          A short description of what the session is for, such
                          as `nightly deploy` or `support ticket triage`. Up to
                          128 characters, without line breaks, tabs, or
                          invisible characters. Shown wherever the session is
                          listed.
                      actor:
                        anyOf:
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - user
                                description: >-
                                  Whether the session belongs to a user or a
                                  machine identity.
                              id:
                                type: string
                                format: uuid
                                nullable: true
                                description: >-
                                  The ID of the user or machine identity the
                                  session belongs to, or null if it was deleted.
                              username:
                                type: string
                                description: >-
                                  The username of the user. Once the user is
                                  deleted, the email recorded when the session
                                  was created.
                              email:
                                type: string
                                nullable: true
                                description: >-
                                  The email address of the user. Once the user
                                  is deleted, the email recorded when the
                                  session was created.
                              firstName:
                                type: string
                                nullable: true
                                description: >-
                                  The first name of the user. Once the user is
                                  deleted, the full name recorded when the
                                  session was created.
                              lastName:
                                type: string
                                nullable: true
                                description: >-
                                  The last name of the user, or null once the
                                  user is deleted.
                            required:
                              - type
                              - id
                              - username
                              - email
                              - firstName
                              - lastName
                            additionalProperties: false
                            title: User
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - machineIdentity
                                description: >-
                                  Whether the session belongs to a user or a
                                  machine identity.
                              id:
                                type: string
                                format: uuid
                                nullable: true
                                description: >-
                                  The ID of the user or machine identity the
                                  session belongs to, or null if it was deleted.
                              name:
                                type: string
                                description: >-
                                  The name of the machine identity. Once the
                                  machine identity is deleted, the name recorded
                                  when the session was created.
                            required:
                              - type
                              - id
                              - name
                            additionalProperties: false
                            title: Machine identity
                      status:
                        type: string
                        enum:
                          - active
                          - revoked
                          - expired
                      expiresAt:
                        type: string
                        format: date-time
                        nullable: true
                        description: When the session expires, or null when it never does.
                      revokedAt:
                        type: string
                        format: date-time
                        nullable: true
                      createdAt:
                        type: string
                        format: date-time
                      accessBundles:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              nullable: true
                            name:
                              type: string
                            position:
                              type: number
                          required:
                            - id
                            - name
                            - position
                          additionalProperties: false
                    required:
                      - id
                      - label
                      - actor
                      - status
                      - expiresAt
                      - revokedAt
                      - createdAt
                      - accessBundles
                    additionalProperties: false
                required:
                  - session
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.