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

# Create Api Key



## OpenAPI

````yaml /openapi.json post /v1/workspaces/{workspace_id}/api-keys
openapi: 3.1.0
info:
  description: Versioned API for hosted Almanac wikis.
  title: Almanac V1 API
  version: 0.5.0
servers:
  - url: https://api.usealmanac.com
security:
  - bearerAuth: []
tags:
  - description: Session, onboarding, overview, and email preferences.
    name: Account
  - description: Workspace discovery and details.
    name: Workspaces
  - description: Wiki creation, listing, and details.
    name: Wikis
  - description: Wiki pages, search, topics, and provenance.
    name: Pages
  - description: Source records, trees, search, and original files.
    name: Sources
  - description: Source uploads and upload records.
    name: Uploads
  - description: Ingest and Garden jobs, events, and outcomes.
    name: Jobs
  - description: Workspace-scoped developer keys.
    name: API keys
  - description: Workspace membership and invitations.
    name: Members
  - description: Workspace plans, usage, and billing portal.
    name: Billing
paths:
  /v1/workspaces/{workspace_id}/api-keys:
    post:
      tags:
        - API keys
      summary: Create Api Key
      operationId: create_api_key_v1_workspaces__workspace_id__api_keys_post
      parameters:
        - in: path
          name: workspace_id
          required: true
          schema:
            title: Workspace Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HostedApiKeyCreated'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  request_id:
                    type: string
                required:
                  - error
                  - message
                  - request_id
                type: object
          description: Invalid request
components:
  schemas:
    CreateApiKeyRequest:
      additionalProperties: false
      properties:
        name:
          minLength: 1
          title: Name
          type: string
        permissions:
          items:
            type: string
          title: Permissions
          type: array
      required:
        - name
      title: CreateApiKeyRequest
      type: object
    HostedApiKeyCreated:
      additionalProperties: false
      properties:
        api_key_id:
          title: Api Key Id
          type: string
        created_at:
          title: Created At
          type: string
        expires_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Expires At
        last_used_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Used At
        name:
          title: Name
          type: string
        obfuscated_value:
          title: Obfuscated Value
          type: string
        permissions:
          items:
            type: string
          title: Permissions
          type: array
        updated_at:
          title: Updated At
          type: string
        value:
          title: Value
          type: string
      required:
        - api_key_id
        - name
        - obfuscated_value
        - created_at
        - updated_at
        - value
      title: HostedApiKeyCreated
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: Almanac access token or API key
      scheme: bearer
      type: http

````