/api/orgs/{org_id}/observation-exportConnect 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_idstringrequiredYour organization id (uuid).
GET /api/whoamireturns it.
Request body
enabledbooleanrequiredinclude_contentbooleanExport prompt and response content with each span.
langfuseobject | nullKeys to connect or rotate the Langfuse project; omit to use the stored connection.
One of
object
public_keystringrequiredLangfuse project public key (
pk-lf-...).secret_keystringrequiredLangfuse project secret key (
sk-lf-...) from the same project.hoststring | nullHosted Langfuse region:
https://cloud.langfuse.com,https://us.cloud.langfuse.com,https://jp.cloud.langfuse.comorhttps://hipaa.cloud.langfuse.com. Omit to keep the stored host.
Responses
200The export state after the write.
Response
connectedbooleanrequiredA Langfuse connection exists.
hoststring | nullrequiredThe Langfuse host.
credential_last4string | nullrequiredLast four characters of the stored secret key.
enabledbooleanrequiredGateway calls are being exported.
include_contentbooleanrequiredExported spans carry prompt and response content.
400The key pair is malformed.
Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
401Missing, unknown or revoked API key.
Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
403The 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
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
404The resource does not exist or belongs to another organization.
Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
409No Langfuse connection to export to, its stored keys need rotating, or its host is not a hosted region.
Response
errorstringrequiredHuman-readable message.
codestringStable machine reason, when the route defines one (for example
pro_required).actionstringStable remediation action, when the route defines one.
detailsobjectCustomer-safe string facts the caller needs to act (for example a suggested identifier).
422The body failed validation, or
langfuse.hostis 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