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

# Create API key

> Create a new API key. The full key value is only returned once at creation.



## OpenAPI

````yaml api-docs/archived/auth.json post /v1/regions/global/iam/apikeys
openapi: 3.1.1
info:
  title: Auth & IAM API
  version: 1.0.0
  description: >-
    Authentication and Identity Access Management API for the k0rdent Enterprise
    platform. Provides OAuth2/OIDC token management, session lifecycle, user
    management, RBAC, service accounts, API keys, and identity provider
    configuration.
  contact:
    name: k0rdent Enterprise API Support
    email: api-support@example.com
    url: https://support.example.com
  license:
    name: Proprietary
    url: https://k0rdent.example.com/license
servers:
  - url: ''
    description: For documentation only
  - url: https://api.example.com
    description: Arc API Base URL
  - url: https://api.internal.example.com
    description: Atlas API Base URL
  - url: http://localhost:{port}
    description: Local Development
    variables:
      port:
        default: '4050'
        description: Auth service port
security: []
paths:
  /v1/regions/global/iam/apikeys:
    post:
      tags:
        - IAM API Keys
      summary: Create API key
      description: >-
        Create a new API key. The full key value is only returned once at
        creation.
      operationId: createApiKey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                scopes:
                  type: array
                  items:
                    type: string
                expiresAt:
                  type: string
                  format: date-time
                  nullable: true
              required:
                - name
                - scopes
      responses:
        '201':
          description: API key created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    allOf:
                      - $ref: '#/components/schemas/ApiKey'
                      - type: object
                        properties:
                          key:
                            type: string
                            description: Full API key value (only returned at creation)
components:
  schemas:
    ApiKey:
      type: object
      description: API key for programmatic access
      properties:
        id:
          type: string
          description: API key identifier
        name:
          type: string
          description: Key name/label
        prefix:
          type: string
          description: Key prefix for identification (e.g., k0r_)
        scopes:
          type: array
          items:
            type: string
          description: Authorized scopes
        expiresAt:
          type: string
          format: date-time
          nullable: true
          description: Key expiration (null = no expiry)
        lastUsedAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - prefix
        - scopes

````