> ## Documentation Index
> Fetch the complete documentation index at: https://factory-docs-auto-sync-jp-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke a service account API key

> Revokes an API key for a service account. Once revoked, the key can no longer authenticate. Idempotent.



## OpenAPI

````yaml https://api.factory.ai/api/v0/openapi.json post /api/v0/service-accounts/{serviceAccountId}/api-keys/{keyId}/revoke
openapi: 3.0.1
info:
  title: Factory Public API
  description: >-
    Public API for Factory platform. Requires authentication via the
    `Authorization: Bearer` header.
  version: 0.1.0
servers:
  - url: https://api.factory.ai/
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v0/service-accounts/{serviceAccountId}/api-keys/{keyId}/revoke:
    post:
      tags:
        - Service Accounts
      summary: Revoke a service account API key
      description: >-
        Revokes an API key for a service account. Once revoked, the key can no
        longer authenticate. Idempotent.
      operationId: revokeServiceAccountApiKey
      parameters:
        - name: serviceAccountId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            description: Service account ID
        - name: keyId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            description: API key ID
      responses:
        '204':
          description: Response for status 204
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevokeServiceAccountApiKey204ResponseBody'
        '401':
          description: Response for status 401
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevokeServiceAccountApiKey401ResponseBody'
        '403':
          description: Response for status 403
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevokeServiceAccountApiKey403ResponseBody'
        '404':
          description: Response for status 404
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevokeServiceAccountApiKey404ResponseBody'
        '500':
          description: Response for status 500
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevokeServiceAccountApiKey500ResponseBody'
components:
  schemas:
    RevokeServiceAccountApiKey204ResponseBody:
      type: object
      properties: {}
      additionalProperties: false
    RevokeServiceAccountApiKey401ResponseBody:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
        status:
          type: number
          description: HTTP status code
        title:
          type: string
          description: HTTP status title
        metadata:
          type: object
          additionalProperties: {}
          description: Additional error metadata
      required:
        - detail
        - status
        - title
      additionalProperties: false
    RevokeServiceAccountApiKey403ResponseBody:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
        status:
          type: number
          description: HTTP status code
        title:
          type: string
          description: HTTP status title
        metadata:
          type: object
          additionalProperties: {}
          description: Additional error metadata
      required:
        - detail
        - status
        - title
      additionalProperties: false
    RevokeServiceAccountApiKey404ResponseBody:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
        status:
          type: number
          description: HTTP status code
        title:
          type: string
          description: HTTP status title
        metadata:
          type: object
          additionalProperties: {}
          description: Additional error metadata
      required:
        - detail
        - status
        - title
      additionalProperties: false
    RevokeServiceAccountApiKey500ResponseBody:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
        status:
          type: number
          description: HTTP status code
        title:
          type: string
          description: HTTP status title
        metadata:
          type: object
          additionalProperties: {}
          description: Additional error metadata
      required:
        - detail
        - status
        - title
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Factory API key or JWT token for authentication

````