PUT/api/orgs/{org_id}/observation-export

Connect Langfuse and turn live export on or off

Send langfuse keys to connect or rotate the project in the same call. Turning export on also turns broadcast off on that connection so no call arrives twice. 409 when there is no Langfuse connection yet, the stored keys need rotating, or the stored host is not a hosted Langfuse region. Needs an org admin or the organization's own API key.

Authentication: Bearer API key in the Authorization header

Path parameters

  • org_idstringrequired

    Your organization id (uuid). GET /api/whoami returns it.

Request body

  • enabledbooleanrequired
  • include_contentboolean

    Export prompt and response content with each span.

    Default: true
  • langfuseobject | null

    Keys to connect or rotate the Langfuse project; omit to use the stored connection.

    One of

    object

    • public_keystringrequired

      Langfuse project public key (pk-lf-...).

    • secret_keystringrequired

      Langfuse project secret key (sk-lf-...) from the same project.

    • hoststring | null

      Hosted Langfuse region: https://cloud.langfuse.com, https://us.cloud.langfuse.com, https://jp.cloud.langfuse.com or https://hipaa.cloud.langfuse.com. Omit to keep the stored host.

Responses

  • 200

    The export state after the write.

    Response
    • connectedbooleanrequired

      A Langfuse connection exists.

    • hoststring | nullrequired

      The Langfuse host.

    • credential_last4string | nullrequired

      Last four characters of the stored secret key.

    • enabledbooleanrequired

      Gateway calls are being exported.

    • include_contentbooleanrequired

      Exported spans carry prompt and response content.

  • 400

    The key pair is malformed.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 401

    Missing, unknown or revoked API key.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 403

    The key is valid but may not perform this action (for example an inference key on a provisioning-key route, or a feature outside your plan).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 404

    The resource does not exist or belongs to another organization.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 409

    No Langfuse connection to export to, its stored keys need rotating, or its host is not a hosted region.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 422

    The body failed validation, or langfuse.host is not a hosted Langfuse region.

Request

curl -X PUT https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/observation-export \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": true,
  "include_content": true,
  "langfuse": {
    "public_key": "pk-lf-2b8e4c1a-7f3d-4e9a-b6c0-1d5f8a2e9c4b",
    "secret_key": "sk-lf-9a1c3e5f-2b4d-4f6a-8c0e-7d9b1a3c5e7c",
    "host": "https://cloud.langfuse.com"
  }
}'

Response

{
  "connected": true,
  "host": "https://cloud.langfuse.com",
  "credential_last4": "5e7c",
  "enabled": true,
  "include_content": true
}

https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/observation-export