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

# Update Sub-account API Key

> Enables or disables the API key identified by its ID for the specified sub-account.
A disabled API key cannot be used to authenticate requests until it is enabled again.
Currently, `enabled` is the only field that can be updated, and it must be included in the request body.




## OpenAPI

````yaml /email-api/api-reference/openapi.yaml patch /sub-account/{handle}/api-key/{id}
openapi: 3.0.0
info:
  contact:
    email: support@mailchannels.com
    name: MailChannels Corporation
  description: >
    This is the API reference for Email API. Here, you'll find more detailed
    information on every endpoint, including parameters, response formats, and
    error codes.
  title: Email API
  version: 1.10.0
servers:
  - url: https://api.mailchannels.net/tx/v1
security: []
tags:
  - name: Send
  - name: DKIM
  - name: Metrics
  - name: Sub-accounts
  - name: Suppression
  - name: Webhooks
  - name: Usage
  - name: Custom Tracking
paths:
  /sub-account/{handle}/api-key/{id}:
    patch:
      tags:
        - Sub-accounts
      summary: Update Sub-account API Key
      description: >
        Enables or disables the API key identified by its ID for the specified
        sub-account.

        A disabled API key cannot be used to authenticate requests until it is
        enabled again.

        Currently, `enabled` is the only field that can be updated, and it must
        be included in the request body.
      parameters:
        - description: |
            Handle of the sub-account for which the API key should be updated.
          in: path
          name: handle
          required: true
          schema:
            type: string
        - description: The ID of the API key to update.
          in: path
          name: id
          required: true
          schema:
            type: integer
        - in: header
          name: X-Api-Key
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APIKeyPatchRequestBody'
        required: true
      responses:
        '204':
          description: |
            The API key was successfully updated for the sub-account.
        '400':
          description: |
            Missing or invalid API key ID, or the request body is invalid.
        '404':
          description: |
            The specified sub-account or API key does not exist.
        '500':
          description: |
            An unexpected internal error occurred.
components:
  schemas:
    APIKeyPatchRequestBody:
      properties:
        enabled:
          description: >
            Whether the API key is enabled. Set to `false` to disable the key,
            or `true` to enable it again.
          type: boolean
      required:
        - enabled
      type: object

````

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