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

# Post v2orgs api keys

> Create a new API key for the organization. The raw key is returned only once.



## OpenAPI

````yaml /api-reference/swagger.yml post /v2/orgs/{orgSlug}/api-keys
openapi: 3.0.0
info:
  version: 1.0.0
  title: Prisme.ai APIs
  description: Prisme.ai APIs specifications
  termsOfService: https://www.prisme.ai/mentions-legales
  contact:
    name: Prisme.ai Support Team
    email: support@prisme.ai
    url: https://www.prisme.ai
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.eda.prisme.ai
  - url: http://localhost:3001
security:
  - BearerAuth: []
  - WorkspaceApiKeyAuth: []
  - BearerAuth: []
    WorkspaceApiKeyAuth: []
paths:
  /v2/orgs/{orgSlug}/api-keys:
    post:
      tags:
        - Organizations
      description: >-
        Create a new API key for the organization. The raw key is returned only
        once.
      operationId: createOrgApiKey
      parameters:
        - name: orgSlug
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - slug
                - name
                - expiresAt
              properties:
                slug:
                  type: string
                  description: Unique identifier for this API key within the organization
                name:
                  type: string
                permissions:
                  type: array
                  description: >-
                    Array of permission strings. Convention:
                    {product}:{resource}:{action}

                    Wildcards: Use * at end only (e.g., orgs:* matches
                    orgs:members:manage)

                    Platform permissions: - orgs:* (full org access) -
                    orgs:members:manage, orgs:roles:manage, orgs:manage -
                    orgs:branding:manage, orgs:navigation:manage -
                    orgs:subscriptions:view, orgs:subscriptions:manage -
                    orgs:apikeys:manage, orgs:invites:manage,
                    orgs:join-rules:manage - secure-chat:*, store:*,
                    knowledge:*, builder:* - agent-builder:*, analytics:view,
                    platform-admin:*

                    Custom app permissions: {app-slug}:{resource}:{action}
                    Example: my-crm:contacts:read, my-crm:deals:manage

                    Super admin: ["*"] (matches everything)
                  items:
                    type: string
                scopes:
                  type: array
                  items:
                    type: string
                  description: >-
                    Optional resource patterns restricting where permissions
                    apply. Format: resourceType:resourceId
                expiresAt:
                  type: string
                  format: date-time
      responses:
        '201':
          description: API key created. The raw key is shown only once.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgApiKeyWithSecret'
        '401':
          description: AuthenticationError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
components:
  schemas:
    OrgApiKeyWithSecret:
      type: object
      description: Returned on create/rotate — raw key shown only once
      properties:
        id:
          type: string
          description: Internal role ID
        slug:
          type: string
          description: Unique slug identifying the API key within the org
        apiKey:
          type: string
          description: The raw API key (iak_{orgSlug}_{uuid}). Shown only once.
        name:
          type: string
        permissions:
          type: array
          description: >-
            Array of permission strings. Convention:
            {product}:{resource}:{action}

            Wildcards: Use * at end only (e.g., orgs:* matches
            orgs:members:manage)

            Platform permissions: - orgs:* (full org access) -
            orgs:members:manage, orgs:roles:manage, orgs:manage -
            orgs:branding:manage, orgs:navigation:manage -
            orgs:subscriptions:view, orgs:subscriptions:manage -
            orgs:apikeys:manage, orgs:invites:manage, orgs:join-rules:manage -
            secure-chat:*, store:*, knowledge:*, builder:* - agent-builder:*,
            analytics:view, platform-admin:*

            Custom app permissions: {app-slug}:{resource}:{action} Example:
            my-crm:contacts:read, my-crm:deals:manage

            Super admin: ["*"] (matches everything)
          items:
            type: string
        expiresAt:
          type: string
          format: date-time
    AuthenticationError:
      type: object
      properties:
        error:
          type: string
          example: AuthenticationError
        message:
          type: string
          example: Unauthenticated
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          example: ForbiddenError
        message:
          type: string
          example: Forbidden
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key

````