Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Langfuse Langfuse API Organizations Schema

From Leeroopedia
Knowledge Sources
Domains API, Organizations
Last Updated 2026-02-14 00:00 GMT

Overview

Fern API definition for the admin-level organizations management API, providing CRUD operations for organizations and their API keys.

Description

This file defines the admin API contract under /api/admin for managing Langfuse organizations. It contains eight endpoints organized into two groups:

Organization Management:

  • GET /api/admin/organizations -- List all organizations
  • POST /api/admin/organizations -- Create a new organization
  • GET /api/admin/organizations/{organizationId} -- Get organization by ID
  • PUT /api/admin/organizations/{organizationId} -- Update an organization
  • DELETE /api/admin/organizations/{organizationId} -- Delete an organization

API Key Management:

  • GET /api/admin/organizations/{organizationId}/apiKeys -- List API keys for an organization
  • POST /api/admin/organizations/{organizationId}/apiKeys -- Create a new API key
  • DELETE /api/admin/organizations/{organizationId}/apiKeys/{apiKeyId} -- Delete an API key

All endpoints use authentication and may return UnauthorizedError or MethodNotAllowedError from the commons import.

Usage

Developers reference this definition when:

  • Building admin tooling or automation for organization management
  • Generating SDK types for the admin API surface
  • Implementing programmatic API key rotation workflows
  • Understanding the organization data model (projects, metadata)

Code Reference

Source Location

Signature

service:
  auth: true
  base-path: /api/admin
  endpoints:
    getAll:
      docs: Get all organizations
      method: GET
      path: /organizations
      response: Organizations

    create:
      docs: Create a new organization
      method: POST
      path: /organizations
      request:
        name: CreateOrganizationRequest
        body:
          properties:
            name: string
            metadata: optional<map<string, unknown>>
      response: Organization

    getById:
      method: GET
      path: /organizations/{organizationId}
      response: Organization

    update:
      method: PUT
      path: /organizations/{organizationId}
      response: Organization

    delete:
      method: DELETE
      path: /organizations/{organizationId}
      response: DeleteOrganizationResponse

    getApiKeys:
      method: GET
      path: /organizations/{organizationId}/apiKeys
      response: ApiKeyList

    createApiKey:
      method: POST
      path: /organizations/{organizationId}/apiKeys
      response: ApiKeyResponse

    deleteApiKey:
      method: DELETE
      path: /organizations/{organizationId}/apiKeys/{apiKeyId}
      response: DeleteOrganizationResponse

I/O Contract

Endpoints

Method Path Description
GET /api/admin/organizations List all organizations
POST /api/admin/organizations Create a new organization with name and optional metadata
GET /api/admin/organizations/{organizationId} Get a single organization by ID
PUT /api/admin/organizations/{organizationId} Update organization name and metadata
DELETE /api/admin/organizations/{organizationId} Delete an organization
GET /api/admin/organizations/{organizationId}/apiKeys List all API keys for an organization
POST /api/admin/organizations/{organizationId}/apiKeys Create a new API key with optional note
DELETE /api/admin/organizations/{organizationId}/apiKeys/{apiKeyId} Delete a specific API key

Key Types

Type Name Description
Organizations Wrapper containing a list of Organization objects
Organization Organization with id, name, createdAt, metadata, and nested projects list
OrganizationProject Project belonging to an organization (id, name, metadata, timestamps)
DeleteOrganizationResponse Success boolean response for deletion operations
ApiKeyList Wrapper containing a list of ApiKeySummary objects
ApiKeySummary API key summary with id, timestamps, note, publicKey, and masked secretKey
ApiKeyResponse Full API key response including the unmasked secretKey (returned only on creation)

Usage Examples

# List all organizations
curl -X GET "https://cloud.langfuse.com/api/admin/organizations" \
  -H "Authorization: Bearer $ADMIN_API_KEY"

# Create a new organization
curl -X POST "https://cloud.langfuse.com/api/admin/organizations" \
  -H "Authorization: Bearer $ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "My Organization", "metadata": {"tier": "enterprise"}}'

# Create an API key for an organization
curl -X POST "https://cloud.langfuse.com/api/admin/organizations/org-123/apiKeys" \
  -H "Authorization: Bearer $ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"note": "Production API key"}'

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment