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

# List API Keys

> List all API keys for the organization. Only org admins can list keys.



## OpenAPI

````yaml openapi.json GET /api_keys
openapi: 3.1.0
info:
  title: Sb0 API
  version: 0.1.0
servers: []
security: []
paths:
  /api_keys:
    get:
      tags:
        - API Keys
      summary: List API Keys
      description: List all API keys for the organization. Only org admins can list keys.
      operationId: api_keys_list
      parameters:
        - in: query
          name: include_revoked
          required: false
          schema:
            default: false
            title: Include Revoked
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyListResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    ApiKeyListResponse:
      description: Response model for listing API keys.
      properties:
        api_keys:
          description: List of API keys.
          items:
            $ref: '#/components/schemas/ApiKeyResponse'
          title: Api Keys
          type: array
      title: ApiKeyListResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ApiKeyResponse:
      description: Response model for API key (excludes sensitive data).
      properties:
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the key was created.
          title: Created At
        created_by:
          description: member_id of the creator.
          title: Created By
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional description.
          title: Description
        id:
          description: The unique identifier of the API key.
          title: Id
          type: string
        key_prefix:
          description: Display prefix (e.g., 'sk_tu_abc...').
          title: Key Prefix
          type: string
        last_used_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the key was last used.
          title: Last Used At
        name:
          description: Human-readable name for the API key.
          title: Name
          type: string
        org_id:
          description: WorkOS organization ID.
          title: Org Id
          type: string
        revoked_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the key was revoked (soft delete).
          title: Revoked At
        scopes:
          description: List of resource scopes for this API key.
          items:
            $ref: '#/components/schemas/ApiKeyScope'
          title: Scopes
          type: array
        sharing_group_ids:
          description: >-
            Groups that receive default admin grants on resources created by
            this key.
          items:
            type: string
          title: Sharing Group Ids
          type: array
      required:
        - id
        - org_id
        - key_prefix
        - name
        - created_by
      title: ApiKeyResponse
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    ApiKeyScope:
      description: Scope definition for an API key - defines resource and role access.
      properties:
        resource_id:
          description: ID of the resource.
          title: Resource Id
          type: string
        resource_type:
          description: Type of resource (namespace, project, agent).
          title: Resource Type
          type: string
        role:
          $ref: '#/components/schemas/ApiKeyScopeRole'
          description: Role for this resource.
      required:
        - resource_type
        - resource_id
        - role
      title: ApiKeyScope
      type: object
    ApiKeyScopeRole:
      description: Role that can be assigned to an API key for a scoped resource.
      enum:
        - discoverer
        - viewer
        - editor
        - admin
        - owner
        - member
        - executor
      title: ApiKeyScopeRole
      type: string

````