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

# Update an API key

> Requires the `api_key:write` ability.



## OpenAPI

````yaml /api-reference/api.json put /api-keys/{api_key}
openapi: 3.1.0
info:
  title: ezyshield
  version: 0.0.1
servers:
  - url: https://app.ezyshield.com.au/api
    description: Production
  - url: https://sandbox.ezyshield.com.au/api
    description: Sandbox
security:
  - http: []
tags:
  - name: Organizations
  - name: API Keys
  - name: Verifications
  - name: Checks
  - name: ABA checks
  - name: Webhook Subscriptions
  - name: Webhook Events
paths:
  /api-keys/{api_key}:
    put:
      tags:
        - API Keys
      summary: Update an API key
      description: Requires the `api_key:write` ability.
      operationId: api-keys.update
      parameters:
        - name: api_key
          in: path
          required: true
          description: 'The API key ID. Example: `key_01jz8v2q4x...`'
          schema:
            type: string
        - name: include
          in: query
          schema:
            type: array
            items:
              type: string
              enum:
                - creator
          explode: false
        - name: fields[api-keys]
          in: query
          schema:
            type: array
            items:
              type: string
              enum:
                - name
                - token
                - abilities
                - created_at
                - last_used_at
                - expires_at
          explode: false
        - name: fields[users]
          in: query
          schema:
            type: array
            items:
              type: string
              enum:
                - name
                - email
                - created_at
                - updated_at
          explode: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateApiKeyRequest'
      responses:
        '200':
          description: '`ApiKeyResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ApiKeyResource'
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserResource'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    UpdateApiKeyRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the API key.
          maxLength: 255
      required:
        - name
      title: UpdateApiKeyRequest
    ApiKeyResource:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          const: api-keys
        attributes:
          type: object
          properties:
            name:
              type: string
              description: The name of the API key.
            token:
              type:
                - string
                - 'null'
              description: The plain text token, only shown once when created.
            abilities:
              type: array
              description: The abilities/permissions for the API key.
              items:
                type: string
            created_at:
              type: string
              description: ISO 8601 formatted date-time.
            last_used_at:
              type: string
              description: ISO 8601 formatted date-time.
            expires_at:
              type: string
              description: ISO 8601 formatted date-time.
        relationships:
          type: object
          properties:
            creator:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    type:
                      type: string
                      const: users
                  required:
                    - id
                    - type
              required:
                - data
      required:
        - id
        - type
      title: ApiKeyResource
    UserResource:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          const: users
        attributes:
          type: object
          properties:
            name:
              type: string
              description: The name of the user.
            email:
              type: string
              description: The email address of the user.
            created_at:
              type: string
              description: ISO 8601 formatted date-time.
            updated_at:
              type: string
              description: ISO 8601 formatted date-time.
      required:
        - id
        - type
      title: UserResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      scheme: bearer

````