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

# Create an API key

> Creates a key that acts with your permissions. The response holds the full key in `plaintext`; you can copy it again later from Settings > Developers. A workspace can have up to 50 active keys.




## OpenAPI

````yaml /openapi/workspace.yaml post /workspaces/{workspaceId}/api-keys
openapi: 3.1.0
info:
  title: Connie Workspace API
  version: 1.0.0
  description: >
    Endpoints the Connie web app uses for workspace settings, members and API
    keys. They authenticate with your signed-in browser session — see
    https://docs.connie.ai/api-reference/authentication. These are the app's own
    endpoints and can change when the app changes.
servers:
  - url: https://connie.ai/api
security:
  - sessionCookie: []
tags:
  - name: Settings
    description: The workspace name, logo and memory switch. Owners and admins only.
  - name: Members
    description: People in the workspace and their roles.
  - name: Invitations
    description: Email invitations and the workspace invite link.
  - name: Join requests
    description: People who asked to join the workspace.
  - name: API keys
    description: >
      Workspace API keys for MCP clients and agents. Keys work only with the
      Connie MCP server; these web app endpoints don't accept them.
paths:
  /workspaces/{workspaceId}/api-keys:
    post:
      tags:
        - API keys
      summary: Create an API key
      description: >
        Creates a key that acts with your permissions. The response holds the
        full key in `plaintext`; you can copy it again later from Settings >
        Developers. A workspace can have up to 50 active keys.
      operationId: createApiKey
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              additionalProperties: false
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Name it after the tool or computer that will use it.
            example:
              name: Codex on laptop
      responses:
        '201':
          description: The new key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  key:
                    $ref: '#/components/schemas/ApiKey'
                  plaintext:
                    type: string
                    description: The full key, starting with `sk_`. Keep it secret.
        '400':
          description: The name is missing, too long, or the body has other fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Not a member, or a guest.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            "A workspace can have up to 50 active API keys. Revoke one you no
            longer use."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  parameters:
    workspaceId:
      name: workspaceId
      in: path
      required: true
      description: The workspace id, as in the app URL `connie.ai/<workspaceId>/...`.
      schema:
        type: string
        format: uuid
  schemas:
    ApiKey:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        prefix:
          type: string
          description: The start of the key, shown in place of the full value.
        permissions:
          type: array
          items:
            type: string
          example:
            - mcp:access
            - tools:read
            - tools:execute
        executionUserId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            The member whose permissions the key uses. Its creator unless an
            owner or admin changed it.
        isPersonal:
          type: boolean
          description: The personal key every member gets automatically.
        isMine:
          type: boolean
          description: You created this key.
        revealable:
          type: boolean
          description: You can copy this key's value again.
        createdBy:
          type:
            - string
            - 'null'
          format: uuid
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
        lastUsedAt:
          type:
            - string
            - 'null'
          format: date-time
        expiresAt:
          type:
            - string
            - 'null'
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          description: A readable message.
        code:
          type: string
          description: >-
            A machine-readable code such as `VALIDATION_ERROR`, `FORBIDDEN` or
            `CONFLICT`, when the route sets one.
  responses:
    Unauthorized:
      description: No valid session, or the session has expired (`SESSION_EXPIRED`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: API keys are temporarily unavailable. Try again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: header
      name: Cookie
      description: >-
        The full Cookie header copied from a signed-in connie.ai browser
        request. See the Authentication page.

````

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