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

# Create an API key

> Creates a new API key for the authenticated user with specified permissions and optional expiration.



## OpenAPI

````yaml /openapi.yaml post /api/auth/api_key/create
openapi: 3.1.0
info:
  title: Nuwacom API
  description: API for Nuwacom application
  version: 1.0.0
servers:
  - url: https://{customer-tenant}.nuwacom.ai/
    description: Nuwacom API
security:
  - bearerAuth: []
paths:
  /api/auth/api_key/create:
    post:
      tags:
        - Auth
      summary: Create an API key
      description: >-
        Creates a new API key for the authenticated user with specified
        permissions and optional expiration.
      operationId: postApiAuthApi_keyCreate
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  description: Name for the API key (e.g., "Zapier integration").
                permissions:
                  type: object
                  additionalProperties:
                    type: array
                    items:
                      type: string
                  description: >-
                    A map of space IDs to permissions. Each space ID is
                    associated with an array of permissions that the API key
                    will have access to in that space.
                expiration:
                  anyOf:
                    - type: string
                    - type: number
                  description: >-
                    Optional expiration value (ISO timestamp or UNIX seconds)
                    after which the API key becomes invalid.
              required:
                - name
                - permissions
      responses:
        '200':
          description: API key created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique ID of the newly created API key.
                  key:
                    type: string
                    description: >-
                      The API secret itself. This is confidential and should be
                      stored securely.
                required:
                  - id
                  - key
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````