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

# Create an API key

> Creates an API key for the caller. The key acts with your current role and permission overrides, and stops working if you leave the organization. See [Roles and permissions](/reference/permissions).

The `key` is shown once, in this response. Store it now.

**Required permission:** `api-keys:write`




## OpenAPI

````yaml /api-reference/openapi.yaml post /api/v1/api-keys
openapi: 3.1.0
info:
  title: Igris Management API
  version: '1'
  description: >-
    REST API for managing Igris connections, policies, sessions, audit events
    and alerts.
servers:
  - url: https://api.igrisecurity.com
security:
  - bearerAuth: []
tags:
  - name: Connections
  - name: Policies
  - name: Sessions
  - name: Audit Events
  - name: Incidents
  - name: Webhooks
  - name: API Keys
  - name: Members
  - name: LLM Providers
  - name: LLM Cost
  - name: Observe
paths:
  /api/v1/api-keys:
    post:
      tags:
        - API Keys
      summary: Create an API key
      description: >
        Creates an API key for the caller. The key acts with your current role
        and permission overrides, and stops working if you leave the
        organization. See [Roles and permissions](/reference/permissions).


        The `key` is shown once, in this response. Store it now.


        **Required permission:** `api-keys:write`
      operationId: createApiKey
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 200
                  default: Untitled Key
            example:
              name: CI key
      responses:
        '201':
          description: The new key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      key:
                        type: string
                        description: The full key. Shown only here.
                      prefix:
                        type: string
                      createdAt:
                        type: string
                        format: date-time
              example:
                data:
                  id: key_123
                  name: CI key
                  key: ig_xxxxxxxxxxxxxxxxxxxxxxxx
                  prefix: ig_xxxxxxxx
                  createdAt: '2026-01-01T00:00:00.000Z'
        '400':
          $ref: '#/components/responses/ZodBadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  responses:
    ZodBadRequest:
      description: The body failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ZodValidationError'
    Unauthorized:
      description: No valid session or API key, or the key's creator is no longer a member.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
    Forbidden:
      description: The caller lacks the required permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenError'
  schemas:
    ZodValidationError:
      type: object
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          properties:
            name:
              type: string
              example: ZodError
            message:
              type: string
              description: JSON string of the validation issues.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          example: Forbidden
        required:
          type: string
          description: The permission the caller lacks.
          example: policies:write
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ig_...
      description: >-
        An Igris API key. It acts with the current role and permission overrides
        of the member who created it.

````

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