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

# Issue a new API key (admin)

> Admin-only. The returned `value` is shown ONCE and cannot be retrieved again — store it immediately.



## OpenAPI

````yaml /openapi.yaml post /api/v1/keys
openapi: 3.0.3
info:
  title: Datris API
  description: >
    REST API for the Datris AI Data Platform. Ingest, validate, transform,
    store, and retrieve data.


    For AI agent integration, use the [MCP
    Server](https://docs.datris.ai/mcp-server) instead.
  version: 1.11.3
  contact:
    name: Datris
    url: https://datris.ai
  license:
    name: Apache 2.0
servers:
  - url: http://localhost:8080
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/keys:
    post:
      tags:
        - API Keys
      summary: Issue a new API key (admin)
      description: >-
        Admin-only. The returned `value` is shown ONCE and cannot be retrieved
        again — store it immediately.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - label
              properties:
                label:
                  type: string
                  description: 1-64 chars of lowercase letters, digits, dash, underscore
                capabilities:
                  type: array
                  items:
                    type: string
                  description: >-
                    Capability strings, e.g. "pipeline:read" or
                    "secret:write:_type=tap" (see /keys/capabilities/catalog)
      responses:
        '200':
          description: The new key, including its one-time value
          content:
            application/json:
              schema:
                type: object
                properties:
                  label:
                    type: string
                  value:
                    type: string
                    description: The API key secret — shown only in this response
                  capabilities:
                    type: array
                    items:
                      type: string
                  createdAt:
                    type: string
                  createdBy:
                    type: string
        '400':
          description: Missing/invalid label or invalid capability string
        '409':
          description: A key with this label already exists
        '500':
          description: Error
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional API key for authentication (enabled via application.yaml)

````