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

# Create an API key

> Creates a key. Answers 201 with the whole key once in `key`. Store it at once, because it cannot be read again. This call needs a partner console session. An API key is refused.



## OpenAPI

````yaml /openapi/partner.yaml post /api/v1/partner/keys/
openapi: 3.1.0
info:
  title: ImpelLabs Partner API
  version: '1'
  description: >-
    The Partner API provisions customer businesses (tenants) and runs their
    channels, conversations and templates from your own product. Call it from
    your server with a partner key. Every path ends with a slash.
servers:
  - url: https://api.impellabs.tech
security:
  - bearer: []
tags:
  - name: Keys
    description: Your partner API keys.
  - name: Tenants
    description: Customer businesses, their channels, conversations and templates.
  - name: Webhooks
    description: Where your tenants' events go.
  - name: WhatsApp sign-up
    description: The settings of the hosted WhatsApp sign-up.
paths:
  /api/v1/partner/keys/:
    post:
      tags:
        - Keys
      summary: Create an API key
      description: >-
        Creates a key. Answers 201 with the whole key once in `key`. Store it at
        once, because it cannot be read again. This call needs a partner console
        session. An API key is refused.
      operationId: post_api_v1_partner_keys
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: A name for the key. 120 characters at most.
                scopes:
                  type: array
                  items:
                    type: string
                    enum:
                      - tenants:write
                      - channels:read
                      - channels:write
                      - messages:read
                      - messages:write
                      - assistants:read
                      - assistants:write
                      - knowledge:read
                      - knowledge:write
                      - leads:read
                      - leads:write
                      - tools:write
                      - webhooks:read
                      - webhooks:manage
                      - usage:read
                  description: The scopes the key holds.
                expires_at:
                  type: string
                  description: An optional expiry time, ISO 8601.
                  format: date-time
              required:
                - name
            example:
              name: Server
              scopes:
                - tenants:write
                - channels:read
                - channels:write
                - messages:read
                - messages:write
        required: true
      responses:
        '201':
          description: Success
          content:
            application/json:
              example:
                id: 7c0d1e2f-0000-4000-8000-000000000000
                name: Server
                prefix: implpk_ab12cd
                scopes:
                  - tenants:write
                status: active
                expires_at: null
                last_used_at: null
                created_at: '2026-01-15T09:30:00+00:00'
                key: implpk_ab12cd.YOUR_SECRET
        '400':
          $ref: '#/components/responses/Invalid'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        4XX:
          description: The request is not valid or not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  responses:
    Invalid:
      description: >-
        A field is missing or wrong. The body names each field: {"field": "what
        to fix"}.
    Unauthorized:
      description: The credentials are missing, wrong, expired or revoked.
    Forbidden:
      description: These credentials may not do this.
  schemas:
    Error:
      type: object
      description: >-
        An error. Most errors carry `detail`. Some carry `error` with `code` and
        `message`.
      properties:
        detail:
          type: string
        code:
          type: string
        field:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.