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

# Create API Credentials

> Create a new API key and secret.

Requires the `create:api_credentials` permission, available to users with a `member` or `owner` role in the organization that owns the application.

Allowed permissions for API keys:
    `read:organizations`, `update:organizations`,
    `read:applications`, `update:applications`,
    `read:traces`, `write:traces`.

Returns:
    The created API key and secret.

Security Note:
    The API secret is only returned in this response and cannot be retrieved later.
    Store it securely immediately.



## OpenAPI

````yaml POST /api-keys
openapi: 3.1.0
info:
  title: Unomiq Management API
  description: >-

    API for managing settings for organizations, applications and API keys.


    ## Authentication


    All API endpoints require authentication via JWT token in the Authorization
    header:


    ```

    Authorization: Bearer <your_jwt_token>

    ```
        
  version: 1.0.0
servers:
  - url: https://management-api.unomiq.com
    description: Production
security: []
paths:
  /api-keys:
    post:
      tags:
        - api-keys
      summary: Create Api Credentials
      description: >-
        Create a new API key and secret.


        Requires the `create:api_credentials` permission, available to users
        with a `member` or `owner` role in the organization that owns the
        application.


        Allowed permissions for API keys:
            `read:organizations`, `update:organizations`,
            `read:applications`, `update:applications`,
            `read:traces`, `write:traces`.

        Returns:
            The created API key and secret.

        Security Note:
            The API secret is only returned in this response and cannot be retrieved later.
            Store it securely immediately.
      operationId: create_api_credentials_api_keys_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyCreateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ApiKeyCreateRequest:
      properties:
        app_id:
          type: string
          title: App Id
          description: Application ID this API key belongs to
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
          description: The API key's name
        permissions:
          items:
            type: string
            enum:
              - read:applications
              - read:organizations
              - read:traces
              - update:applications
              - update:organizations
              - write:traces
          type: array
          minItems: 1
          title: Permissions
          description: List of permissions granted to this credential.
      type: object
      required:
        - app_id
        - name
        - permissions
      title: ApiKeyCreateRequest
    ApiKeyCreateResponse:
      properties:
        name:
          type: string
          title: Name
        api_key:
          type: string
          title: Api Key
        api_secret:
          type: string
          title: Api Secret
        created_at:
          type: string
          title: Created At
      type: object
      required:
        - name
        - api_key
        - api_secret
        - created_at
      title: ApiKeyCreateResponse
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````