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

# Update inbox API key

> Turn IMAP / SMTP access on or off for an inbox-scoped API key. With access on, mail apps sign in with the inbox address as the username and the key as the password. Turning it off signs mail apps out at once; the key keeps working for the API. A key with access on can't be revoked. An account-wide key, or a pod-scoped key for this inbox's pod, may update; an inbox-scoped key cannot.



## OpenAPI

````yaml https://api.openmail.sh/openapi.json patch /v1/inboxes/{id}/api-keys/{keyId}
openapi: 3.0.3
info:
  title: OpenMail API
  description: >-
    Email infrastructure API for AI agents. Create inboxes, send and receive
    email, and get real-time notifications via webhooks.
  version: 1.0.0
  license:
    name: Proprietary
servers:
  - url: https://api.openmail.sh
security:
  - bearerAuth: []
tags:
  - name: pods
    description: Isolated sub-accounts for your end users or tenants
  - name: inboxes
    description: Email inboxes and their webhook configuration
  - name: domains
    description: >-
      Custom domains: add your own sending/receiving domain, publish DNS, and
      verify it
  - name: owned-domains
    description: >-
      Domains your organisation controls but does not send from. Prove ownership
      with one TXT record and mail to their addresses stops counting toward the
      cold outreach limits.
  - name: messages
    description: Sending and listing messages
  - name: folders
    description: Inbox folders and per-message filing
  - name: drafts
    description: Create, view, edit and send saved email drafts
  - name: threads
    description: Conversation threads and read status
  - name: attachments
    description: Downloading and extracting text from attachments
  - name: policy
    description: >-
      Correspondent policy — provider-enforced allow/block rules and allowlist
      mode, scoped per account, pod, or inbox. Account-wide key only.
  - name: limits
    description: >-
      Sending limits: today's cold outreach caps on new recipients, per account,
      inbox, and domain, and what raises them
  - name: webhooks
    description: >-
      Webhook endpoints: where events are sent, how each request is
      authenticated, and the delivery log. Account-wide key only.
  - name: feedback
    description: Reporting bugs, friction, and feature requests to the OpenMail team
paths:
  /v1/inboxes/{id}/api-keys/{keyId}:
    patch:
      tags:
        - inboxes
      summary: Update inbox API key
      description: >-
        Turn IMAP / SMTP access on or off for an inbox-scoped API key. With
        access on, mail apps sign in with the inbox address as the username and
        the key as the password. Turning it off signs mail apps out at once; the
        key keeps working for the API. A key with access on can't be revoked. An
        account-wide key, or a pod-scoped key for this inbox's pod, may update;
        an inbox-scoped key cannot.
      operationId: updateInboxApiKey
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
          description: Inbox ID
        - schema:
            type: string
          in: path
          name: keyId
          required: true
          description: The API key ID to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - mailAccess
              properties:
                mailAccess:
                  type: boolean
                  description: >-
                    Whether mail apps can sign in over IMAP / SMTP with this
                    key.
      responses:
        '200':
          description: Key updated
          content:
            application/json:
              schema:
                description: Key updated
                allOf:
                  - $ref: '#/components/schemas/ApiKey'
        '403':
          description: >-
            The authenticating key is inbox-scoped, or a pod-scoped key for a
            different pod, and cannot manage keys; or access was turned on and
            IMAP / SMTP access isn't available for this organisation
            (`mail_client_access_unavailable`)
          content:
            application/json:
              schema:
                description: >-
                  The authenticating key is inbox-scoped, or a pod-scoped key
                  for a different pod, and cannot manage keys; or access was
                  turned on and IMAP / SMTP access isn't available for this
                  organisation (`mail_client_access_unavailable`)
                allOf:
                  - $ref: '#/components/schemas/Error'
        '404':
          description: Key not found
          content:
            application/json:
              schema:
                description: Key not found
                allOf:
                  - $ref: '#/components/schemas/Error'
components:
  schemas:
    ApiKey:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: OpenMail API key ID
        name:
          type: string
          description: Human-readable label for the key, if set.
          nullable: true
        podId:
          type: string
          description: >-
            ID of the pod this key is scoped to, or null for an account-wide
            key. A pod-scoped key can only access resources in this pod.
          nullable: true
        inboxId:
          type: string
          description: >-
            ID of the inbox this key is confined to, or null. When set, the key
            can only access this single inbox and its threads, messages, and
            drafts (its `podId` is the inbox's pod).
          nullable: true
        tokenPrefix:
          type: string
          description: Non-secret leading characters of the token, to help you identify it.
        last4:
          type: string
          description: Last 4 characters of the token, shown alongside the prefix.
        createdAt:
          type: string
          format: date-time
        lastUsedAt:
          type: string
          format: date-time
          description: When the key last authenticated a request, or null if never used.
          nullable: true
        mailAccess:
          type: boolean
          description: >-
            Whether mail apps can sign in over IMAP / SMTP with this key, using
            the inbox address as the username and the key as the password. Only
            inbox-scoped keys can have it; always false for pod-scoped and
            account-wide keys. A key with mail access can't be revoked until it
            is turned off.
    Error:
      type: object
      additionalProperties: true
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````

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