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

# Create API key

> Creates an API key and returns its secret once. Store the secret immediately; it cannot be retrieved later.



## OpenAPI

````yaml /api/openapi.json post /v1/api-keys
openapi: 3.1.0
info:
  title: Kavenio API
  version: 1.0.0
  license:
    name: Proprietary
    url: https://kavenio.com/terms
  description: Generated OpenAPI document for the stable Kavenio public API.
servers:
  - url: https://api.kavenio.com
security:
  - bearerAuth: []
tags:
  - name: API keys
    description: Manage Kavenio API keys for the authenticated user.
  - name: Integrations
    description: Connect automation clients and manage workflow subscriptions.
  - name: Feature requests
    description: Submit feature requests from authenticated users.
  - name: Posts
    description: Create, schedule, update, and manage post lifecycle actions.
  - name: Queue
    description: Manage reusable post queue schedules and preview slots.
  - name: Media
    description: Upload, presign, and validate media assets.
  - name: Validation
    description: Validate post payloads and platform content length limits.
  - name: Connect
    description: Start and complete account connection flows.
  - name: Accounts
    description: Manage connected social accounts and account health.
  - name: Telegram
    description: Manage Telegram-specific connected account settings.
  - name: Discord
    description: Manage Discord messages, roles, pins, events, and settings.
  - name: Google Business
    description: Manage Google Business locations, reviews, and helpers.
  - name: Ads
    description: Create, read, cancel, and inspect advertising resources.
  - name: Ad audiences
    description: Manage advertising audiences and audience members.
  - name: Ad catalogs
    description: Inspect advertising catalogs and product sets.
  - name: Ad targeting
    description: Search targeting entities and estimate audience reach.
  - name: Ad conversions
    description: Manage conversion destinations and send conversion events.
  - name: Ad leads
    description: Manage lead forms and retrieve advertising leads.
  - name: Tracking tags
    description: Manage Meta tracking tags and tag sharing.
  - name: Platform credentials
    description: Manage organization platform app credentials.
  - name: Analytics
    description: Read provider analytics and operational inbox data.
  - name: WhatsApp conversions
    description: Read and send WhatsApp conversion events.
  - name: Activity
    description: Read operational activity events.
  - name: Webhooks
    description: Manage webhook endpoints and delivery logs.
paths:
  /v1/api-keys:
    post:
      tags:
        - API keys
      summary: Create an API key
      description: >-
        Creates an API key and returns its secret once. Store the secret
        immediately; it cannot be retrieved later.
      operationId: createApiKey
      requestBody:
        required: true
        content:
          application/json:
            example:
              name: Production deploy key
              expiration: 90d
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 128
                expiration:
                  default: never
                  type: string
                  enum:
                    - never
                    - 1d
                    - 7d
                    - 30d
                    - 60d
                    - 90d
                    - 180d
                scopes:
                  minItems: 1
                  type: array
                  items:
                    type: string
                    enum:
                      - accounts:read
                      - posts:read
                      - posts:write
                      - media:write
                      - integrations:subscriptions
              required:
                - name
      responses:
        '201':
          description: API key created. The secret is returned only once.
          content:
            application/json:
              example:
                ok: true
                data:
                  apiKey:
                    id: key_example
                    name: Production deploy key
                    createdAt: '2026-06-25T12:00:00.000Z'
                    expiration: '2026-09-23T12:00:00.000Z'
                    lastUsedAt: null
                    revoked: false
                    expired: false
                  secret: kavenio_test_redacted
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    x-kavenio-const: true
                  data:
                    type: object
                    properties:
                      apiKey:
                        type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                          name:
                            type: string
                            minLength: 1
                          createdAt:
                            type: string
                            minLength: 1
                          expiration:
                            anyOf:
                              - type: string
                              - type: 'null'
                          lastUsedAt:
                            anyOf:
                              - type: string
                              - type: 'null'
                          revoked:
                            type: boolean
                          expired:
                            type: boolean
                          workspaceId:
                            type: string
                            minLength: 1
                          scopes:
                            type: array
                            items:
                              type: string
                              enum:
                                - accounts:read
                                - posts:read
                                - posts:write
                                - media:write
                                - integrations:subscriptions
                        required:
                          - id
                          - name
                          - createdAt
                          - expiration
                          - lastUsedAt
                          - revoked
                          - expired
                          - workspaceId
                          - scopes
                        additionalProperties: false
                      secret:
                        type: string
                        minLength: 1
                    required:
                      - apiKey
                      - secret
                    additionalProperties: false
                required:
                  - ok
                  - data
                additionalProperties: false
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    x-kavenio-const: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        minLength: 1
                      message:
                        type: string
                        minLength: 1
                      details: {}
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - ok
                  - error
                additionalProperties: false
        '409':
          description: An API key with this name already exists.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    x-kavenio-const: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        minLength: 1
                      message:
                        type: string
                        minLength: 1
                      details: {}
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - ok
                  - error
                additionalProperties: false
        '422':
          description: Request body validation failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    x-kavenio-const: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        minLength: 1
                      message:
                        type: string
                        minLength: 1
                      details: {}
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - ok
                  - error
                additionalProperties: false
        '500':
          description: Clerk API key management failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    x-kavenio-const: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        minLength: 1
                      message:
                        type: string
                        minLength: 1
                      details: {}
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - ok
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Clerk session or OAuth token

````