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

# Create API Key

> Create a new API key



## OpenAPI

````yaml /api-reference/openapi.json post /v1/api-keys/
openapi: 3.1.0
info:
  title: Verbex Platform API
  description: API for managing AI agents, calls, phone numbers, and more.
  version: 1.0.0
servers: []
security: []
paths:
  /v1/api-keys/:
    post:
      tags:
        - API Keys
      summary: Create API Key
      description: Create a new API key
      operationId: create_api_key_v1_api_keys__post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAPIKeyRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIKeyCreatedResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateAPIKeyRequest:
      properties:
        name:
          type: string
          title: Name
          description: >-
            A descriptive name for the API key to help identify its purpose and
            usage context
        expiration_days:
          type: integer
          maximum: 365
          minimum: 1
          title: Expiration Days
          description: Number of days until the API key expires, between 1 and 365 days
          default: 30
        permissions:
          items:
            type: string
          type: array
          title: Permissions
          description: >-
            List of permission scopes granted to this API key, controlling what
            API endpoints it can access
      type: object
      required:
        - name
      title: CreateAPIKeyRequest
    APIKeyCreatedResponse:
      properties:
        _id:
          type: string
          title: Id
          description: Unique identifier for this API key in the database
        name:
          type: string
          title: Name
          description: The descriptive name given to this API key
        permissions:
          items:
            type: string
          type: array
          title: Permissions
          description: List of permission scopes granted to this API key
        expiration_date:
          type: string
          format: date-time
          title: Expiration Date
          description: Timestamp when this API key will expire and become invalid
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this API key was created
        revoked:
          type: boolean
          title: Revoked
          description: >-
            Indicates if this API key has been manually revoked before its
            expiration date
          default: false
        created_by_user_id:
          type: string
          title: Created By User Id
          description: Identifier of the user who created this API key
        api_key:
          type: string
          title: Api Key
          description: >-
            The actual API key value. This is only returned once when the key is
            created and cannot be retrieved later
      type: object
      required:
        - _id
        - name
        - permissions
        - expiration_date
        - created_at
        - created_by_user_id
        - api_key
      title: APIKeyCreatedResponse
      example:
        created_at: '2024-01-01T00:00:00'
        expiration_date: '2024-12-31T23:59:59'
        key_id: 507f1f77bcf86cd799439011
        name: Development API Key
        permissions:
          - read
          - write
        revoked: false
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````