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

# Revoke API Key

> Revoke an API key (soft delete -- key becomes unusable).

**Required Role:** ADMIN or OWNER



## OpenAPI

````yaml POST /v1/teams/{team_id}/api-keys/{api_key_id}/revoke
openapi: 3.1.0
info:
  title: Data Raven API
  description: Cloud-to-cloud data transfer platform powered by RClone
  version: 0.5.0
servers: []
security: []
paths:
  /v1/teams/{team_id}/api-keys/{api_key_id}/revoke:
    post:
      tags:
        - API Keys
      summary: Revoke Api Key
      description: |-
        Revoke an API key (soft delete -- key becomes unusable).

        **Required Role:** ADMIN or OWNER
      operationId: revoke_api_key_v1_teams__team_id__api_keys__api_key_id__revoke_post
      parameters:
        - name: api_key_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Api Key Id
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Team Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyResponse'
        '400':
          description: Already revoked
        '404':
          description: API key not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ApiKeyResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        key_id:
          type: string
          title: Key Id
        name:
          type: string
          title: Name
        scopes:
          items:
            type: string
          type: array
          title: Scopes
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        rotated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Rotated At
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
        created_at:
          type: string
          format: date-time
          title: Created At
        created_by:
          type: string
          format: uuid
          title: Created By
        is_active:
          type: boolean
          title: Is Active
          description: Whether the key is currently usable
      type: object
      required:
        - id
        - key_id
        - name
        - scopes
        - expires_at
        - revoked_at
        - rotated_at
        - last_used_at
        - created_at
        - created_by
        - is_active
      title: ApiKeyResponse
      description: Schema for API key metadata (without secret).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````