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

# Update API key tags

> Add, update, or remove tags on an API key. Set a tag value to null to remove it.

<Note>**Required scope:** `admin`</Note>


## OpenAPI

````yaml /openapi.json patch /{org}/api-keys/{id}
openapi: 3.1.0
info:
  title: Depot API
  description: Depot HTTP API v1
  version: 1.0.0
servers:
  - url: https://api.mesa.dev/v1
security:
  - apiKey: []
paths:
  /{org}/api-keys/{id}:
    patch:
      tags:
        - Org
      summary: Update API key tags
      description: >-
        Add, update, or remove tags on an API key. Set a tag value to null to
        remove it.
      operationId: updateApiKey
      parameters:
        - in: path
          name: id
          schema:
            type: string
            minLength: 1
          required: true
        - schema:
            type: string
          in: path
          name: org
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tags:
                  type: object
                  propertyNames:
                    type: string
                    maxLength: 64
                  additionalProperties:
                    anyOf:
                      - type: string
                        maxLength: 256
                      - type: 'null'
              required:
                - tags
      responses:
        '200':
          description: Updated tags
          content:
            application/json:
              schema:
                type: object
                properties:
                  tags:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                required:
                  - tags
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '406':
          description: Not acceptable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      trace_id:
                        description: >-
                          Support correlation id attached to 5xx responses;
                          quote it when reporting an issue
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key

````