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

# Create User API Key

> Create an API key for your account



## OpenAPI

````yaml openapi.json POST /api/api-keys
openapi: 3.1.1
info:
  title: Middlewr API
  description: Short link management platform API
  version: 1.0.0
  contact:
    name: Middlewr
    email: hello@middlewr.com
    url: https://middlewr.com/contact
servers:
  - url: https://api.middlewr.com
security:
  - ApiKeyAuth: []
paths:
  /api/api-keys:
    post:
      tags:
        - API Keys
      operationId: apiKeys.create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
              required:
                - name
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  owner_type:
                    enum:
                      - user
                      - workspace
                    type: string
                  owner_id:
                    type: string
                    format: uuid
                  created_by_id:
                    anyOf:
                      - type: string
                        format: uuid
                      - type: 'null'
                  name:
                    type: string
                  key_prefix:
                    type: string
                  permissions:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: 'null'
                  last_used_at:
                    anyOf:
                      - type: string
                        format: date-time
                        x-native-type: date
                      - type: 'null'
                  created_at:
                    type: string
                    format: date-time
                    x-native-type: date
                  updated_at:
                    anyOf:
                      - type: string
                        format: date-time
                        x-native-type: date
                      - type: 'null'
                  key:
                    type: string
                required:
                  - id
                  - owner_type
                  - owner_id
                  - created_by_id
                  - name
                  - key_prefix
                  - permissions
                  - last_used_at
                  - created_at
                  - updated_at
                  - key
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: A user or workspace API key, created in the dashboard settings.

````

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