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

# Revoke an API key

> Revokes an API key. The key stops working at once and stays in the list as `REVOKED` for audit. Its label is freed for reuse, so the revoked key can no longer be fetched by label. Revoking cannot be undone.



## OpenAPI

````yaml https://monid.ai/openapi.json post /v1/api-keys/{label}/revoke
openapi: 3.1.0
info:
  title: Monid API
  version: 0.1.0
  description: >-
    Agentic payment platform for data. Agents use it to discover and buy data on
    demand. Authenticated routes take a Monid API key as a Bearer token. Errors
    return `{ code, message }`. List endpoints use cursor pagination.
servers:
  - url: https://api.monid.ai
    description: Production
security: []
paths:
  /v1/api-keys/{label}/revoke:
    post:
      tags:
        - API Keys
      summary: Revoke an API key
      description: >-
        Revokes an API key. The key stops working at once and stays in the list
        as `REVOKED` for audit. Its label is freed for reuse, so the revoked key
        can no longer be fetched by label. Revoking cannot be undone.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Label of the API key to revoke.
            example: ci-runner
          required: true
          description: Label of the API key to revoke.
          name: label
          in: path
      responses:
        '200':
          description: API key revoked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKey'
        '400':
          description: >-
            Bad request. The input failed validation, and `message` says which
            field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized. The API key is missing, invalid, expired or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Forbidden. The API key lacks the scope this operation needs, or has
            no workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: API key not found in this workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limited. Wait the number of seconds in the `Retry-After`
            header, then retry. The `RateLimit-Limit`, `RateLimit-Remaining` and
            `RateLimit-Reset` headers describe the limit that applied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Bearer:
            - api_keys:revoke
components:
  schemas:
    ApiKey:
      type: object
      properties:
        label:
          type: string
          description: Human-readable label. Unique per workspace.
          example: ci-runner
        keyPrefix:
          type: string
          description: >-
            The start of the key, `monid_live_` in production. These responses
            never include the rest of the key.
          example: monid_live_
        owner:
          type: string
          description: >-
            The user the key belongs to. A key created by another key belongs to
            the same user.
        createdBy:
          type: string
          description: Who created the key.
          example: USER#user_2abc
        scopes:
          type: array
          items:
            type: string
            enum:
              - '*'
              - runs:*
              - resources:*
              - wallet:*
              - topups:*
              - controls:*
              - api_keys:*
              - webhooks:*
              - usage:*
              - runs:create
              - runs:get
              - runs:list
              - runs:update
              - resources:read
              - resources:create
              - resources:update
              - resources:delete
              - wallet:read
              - wallet:update
              - topups:create
              - controls:read
              - controls:create
              - controls:update
              - controls:delete
              - api_keys:read
              - api_keys:create
              - api_keys:update
              - api_keys:revoke
              - webhooks:read
              - usage:read
          minItems: 1
          description: >-
            The scopes the key holds, fixed at creation. See `GET
            /v1/api-keys/scopes` for every scope.
          example:
            - runs:*
            - resources:*
            - wallet:read
            - topups:*
            - controls:read
            - api_keys:*
            - webhooks:read
            - usage:read
        status:
          type: string
          enum:
            - ACTIVE
            - EXPIRED
            - REVOKED
          description: '`ACTIVE`, `EXPIRED` or `REVOKED`. Only active keys work.'
        origin:
          type: string
          enum:
            - DASHBOARD
            - API
            - AEP
            - SYSTEM
          description: How the key was created, such as `DASHBOARD` or `API`.
        expiresAt:
          type: string
          format: date-time
          description: >-
            When the key stops working, in ISO 8601. Absent when the key never
            expires.
        revokedAt:
          type: string
          format: date-time
          description: When the key was revoked. Present only on revoked keys.
        revokedBy:
          type: string
          description: Who revoked the key. Present only on revoked keys.
          example: USER#user_2abc
        createdAt:
          type: string
          format: date-time
          description: Creation time (ISO 8601).
        lastUsedAt:
          type: string
          format: date-time
          description: Last time the key authenticated a request. Absent if never used.
      required:
        - label
        - keyPrefix
        - owner
        - createdBy
        - scopes
        - status
        - origin
        - createdAt
    Error:
      type: object
      properties:
        code:
          type: integer
          description: HTTP status code, duplicated in the body.
          example: 400
        message:
          type: string
          description: Human-readable error description.
          example: Bad Request
        errorCode:
          type: string
          enum:
            - BAD_REQUEST
            - VALIDATION_FAILED
            - INVALID_JSON
            - INVALID_CURSOR
            - UNAUTHENTICATED
            - FORBIDDEN
            - NOT_FOUND
            - CONFLICT
            - GONE
            - PAYLOAD_TOO_LARGE
            - INTERNAL_ERROR
            - NOT_IMPLEMENTED
            - BAD_GATEWAY
            - SERVICE_UNAVAILABLE
            - WALLET_NOT_ACTIVE
            - WALLET_PROVISIONING
            - WALLET_FAILED
            - RATE_LIMITED
            - X402_WORKSPACE_RESOURCES
            - X402_WORKSPACE_ONLY
            - X402_ACCRUING_COST
            - X402_EXCEEDS_SETTLEMENT_WINDOW
            - X402_VALIDITY_WINDOW_TOO_SHORT
            - X402_UNBOUNDED_PRICE
            - X402_SETTLEMENT_FAILED
            - MPP_WORKSPACE_RESOURCES
            - MPP_WORKSPACE_ONLY
            - MPP_ACCRUING_COST
            - MPP_UNBOUNDED_PRICE
            - MPP_PAYMENT_FAILED
            - MPP_CREDENTIAL_REPLAYED
            - MPP_PROOF_REQUIRED
            - MPP_UNAVAILABLE
            - INSUFFICIENT_SCOPE
            - WALLET_INSUFFICIENT_FUNDS
            - MAX_COST_EXCEEDED
            - IDEMPOTENCY_KEY_REUSED
            - IDEMPOTENCY_KEY_IN_USE
            - IDENTITY_PROVIDER_UNKNOWN
            - IDENTITY_LINK_REQUIRES_SESSION
            - IDENTITY_LINK_STATE_INVALID
            - IDENTITY_VERIFICATION_FAILED
            - IDENTITY_ASSURANCE_INSUFFICIENT
            - IDENTITY_PROVIDER_UNAVAILABLE
            - IDENTITY_ALREADY_LINKED
            - IDENTITY_USER_ALREADY_LINKED
            - IDENTITY_LINK_RATE_LIMITED
            - IDENTITY_REQUIRED
            - PROMO_IDENTITY_REDEEMED
            - PROMO_REDEEM_REQUIRES_SESSION
            - PROMO_CODE_REDEEMED_BY_WORKSPACE
            - PROMO_CODE_REDEEMED_BY_USER
            - PROMO_CODE_EXHAUSTED
            - PROMO_NEW_ACCOUNTS_ONLY
            - WEBHOOK_REQUIRES_SESSION
            - WEBHOOK_URL_NOT_ALLOWED
            - WEBHOOK_ENDPOINT_LIMIT
            - WEBHOOK_ROTATION_LIMIT
          description: >-
            Machine-readable reason, present on every error. Either a specific
            code (for example `MAX_COST_EXCEEDED`) or the generic code of the
            HTTP status (for example `NOT_FOUND`). Treat an unknown value as the
            generic meaning of the status.
        hints:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: object
                properties:
                  kind:
                    type: string
                    enum:
                      - command
                      - discover
                      - inspect
                      - run
                      - getRun
                      - stop
                      - releaseResource
                      - topup
                  command:
                    type: string
                  query:
                    type: string
                  provider:
                    type: string
                  endpoint:
                    type: string
                  runId:
                    type: string
                  resourceId:
                    type: string
                  stripe:
                    type: string
                  dashboard:
                    type: string
                  docs:
                    type: string
                  comment:
                    type: string
                required:
                  - kind
          description: >-
            Optional next actions, rendered for the calling client like
            run-response hints (e.g. the paid TinyFish version on a free-quota
            429 — spending permission required).
      required:
        - code
        - message
        - errorCode
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      description: Monid API key
      x-aep-authentication-method: api-key

````

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