🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
feat: add api endpoint to configure blob storage integration (#9047)
Steffen Schmitzfa5908a74988
diff --git a/fern/apis/server/definition/blob-storage-integrations.yml b/fern/apis/server/definition/blob-storage-integrations.ymlnew file mode 100644index 0000000000..54d31dd8a8--- /dev/null+++ b/fern/apis/server/definition/blob-storage-integrations.yml@@ -0,0 +1,119 @@+# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json+imports:+ commons: ./commons.yml++service:+ auth: true+ base-path: /api/public/integrations/blob-storage+ endpoints:+ getBlobStorageIntegrations:+ docs: Get all blob storage integrations for the organization (requires organization-scoped API key)+ method: GET+ path: ""+ response: BlobStorageIntegrationsResponse++ upsertBlobStorageIntegration:+ docs: Create or update a blob storage integration for a specific project (requires organization-scoped API key). The configuration is validated by performing a test upload to the bucket.+ method: PUT+ path: ""+ request: CreateBlobStorageIntegrationRequest+ response: BlobStorageIntegrationResponse++ deleteBlobStorageIntegration:+ docs: Delete a blob storage integration by ID (requires organization-scoped API key)+ method: DELETE+ path: "/{id}"+ path-parameters:+ id: string+ response: BlobStorageIntegrationDeletionResponse++types:+ BlobStorageIntegrationType:+ enum:+ - S3+ - S3_COMPATIBLE+ - AZURE_BLOB_STORAGE++ BlobStorageIntegrationFileType:+ enum:+ - JSON+ - CSV+ - JSONL++ BlobStorageExportMode:+ enum:+ - FULL_HISTORY+ - FROM_TODAY+ - FROM_CUSTOM_DATE++ BlobStorageExportFrequency:+ enum:+ - hourly+ - daily+ - weekly++ CreateBlobStorageIntegrationRequest:+ properties:+ projectId:+ type: string+ docs: ID of the project in which to configure the blob storage integration+ type: BlobStorageIntegrationType+ bucketName:+ type: string+ docs: Name of the storage bucket+ endpoint:+ type: optional<string>+ docs: Custom endpoint URL (required for S3_COMPATIBLE type)+ region:+ type: string+ docs: Storage region+ accessKeyId:+ type: optional<string>+ docs: Access key ID for authentication+ secretAccessKey:+ type: optional<string>+ docs: Secret access key for authentication (will be encrypted when stored)+ prefix:+ type: optional<string>+ docs: Path prefix for exported files (must end with forward slash if provided)+ exportFrequency: BlobStorageExportFrequency+ enabled:+ type: boolean+ docs: Whether the integration is active+ forcePathStyle:+ type: boolean+ docs: Use path-style URLs for S3 requests+ fileType: BlobStorageIntegrationFileType+ exportMode: BlobStorageExportMode+ exportStartDate:+ type: optional<datetime>+ docs: Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE)++ BlobStorageIntegrationResponse:+ properties:+ id: string+ projectId: string+ type: BlobStorageIntegrationType+ bucketName: string+ endpoint: optional<string>+ region: string+ accessKeyId: optional<string>+ prefix: string+ exportFrequency: BlobStorageExportFrequency+ enabled: boolean+ forcePathStyle: boolean+ fileType: BlobStorageIntegrationFileType+ exportMode: BlobStorageExportMode+ exportStartDate: optional<datetime>+ nextSyncAt: optional<datetime>+ lastSyncAt: optional<datetime>+ createdAt: datetime+ updatedAt: datetime++ BlobStorageIntegrationsResponse:+ properties:+ data: list<BlobStorageIntegrationResponse>++ BlobStorageIntegrationDeletionResponse:+ properties:+ message: stringdiff --git a/web/public/generated/api/openapi.yml b/web/public/generated/api/openapi.ymlindex ef9c6a5baf..88ed76f9cd 100644--- a/web/public/generated/api/openapi.yml+++ b/web/public/generated/api/openapi.yml@@ -560,6 +560,146 @@ paths:application/json:schema:$ref: '#/components/schemas/AnnotationQueueAssignmentRequest'+ /api/public/integrations/blob-storage:+ get:+ description: >-+ Get all blob storage integrations for the organization (requires+ organization-scoped API key)+ operationId: blobStorageIntegrations_getBlobStorageIntegrations+ tags:+ - BlobStorageIntegrations+ parameters: []+ responses:+ '200':+ description: ''+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BlobStorageIntegrationsResponse'+ '400':+ description: ''+ content:+ application/json:+ schema: {}+ '401':+ description: ''+ content:+ application/json:+ schema: {}+ '403':+ description: ''+ content:+ application/json:+ schema: {}+ '404':+ description: ''+ content:+ application/json:+ schema: {}+ '405':+ description: ''+ content:+ application/json:+ schema: {}+ security:+ - BasicAuth: []+ put:+ description: >-+ Create or update a blob storage integration for a specific project+ (requires organization-scoped API key). The configuration is validated+ by performing a test upload to the bucket.+ operationId: blobStorageIntegrations_upsertBlobStorageIntegration+ tags:+ - BlobStorageIntegrations+ parameters: []+ responses:+ '200':+ description: ''+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BlobStorageIntegrationResponse'+ '400':+ description: ''+ content:+ application/json:+ schema: {}+ '401':+ description: ''+ content:+ application/json:+ schema: {}+ '403':+ description: ''+ content:+ application/json:+ schema: {}+ '404':+ description: ''+ content:+ application/json:+ schema: {}+ '405':+ description: ''+ content:+ application/json:+ schema: {}+ security:+ - BasicAuth: []+ requestBody:+ required: true+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/CreateBlobStorageIntegrationRequest'+ /api/public/integrations/blob-storage/{id}:+ delete:+ description: >-+ Delete a blob storage integration by ID (requires organization-scoped+ API key)+ operationId: blobStorageIntegrations_deleteBlobStorageIntegration+ tags:+ - BlobStorageIntegrations+ parameters:+ - name: id+ in: path+ required: true+ schema:+ type: string+ responses:+ '200':+ description: ''+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/BlobStorageIntegrationDeletionResponse'+ '400':+ description: ''+ content:+ application/json:+ schema: {}+ '401':+ description: ''+ content:+ application/json:+ schema: {}+ '403':+ description: ''+ content:+ application/json:+ schema: {}+ '404':+ description: ''+ content:+ application/json:+ schema: {}+ '405':+ description: ''+ content:+ application/json:+ schema: {}+ security:+ - BasicAuth: []/api/public/comments:post:description: >-@@ -1440,7 +1580,7 @@ paths:Notes:- Introduction to data model:- https://langfuse.com/docs/tracing-data-model+ https://langfuse.com/docs/observability/data-model- Batch sizes are limited to 3.5 MB in total. You need to adjust thenumber of events per batch accordingly.@@ -4413,9 +4553,11 @@ paths:in: querydescription: >-Comma-separated list of fields to include in the response. Available- field groups are 'core' (always included), 'io' (input, output,- metadata), 'scores', 'observations', 'metrics'. If not provided, all- fields are included. Example: 'core,scores,metrics'+ field groups: 'core' (always included), 'io' (input, output,+ metadata), 'scores', 'observations', 'metrics'. If not specified,+ all fields are returned. Example: 'core,scores,metrics'. Note:+ Excluded 'observations' or 'scores' fields return empty arrays;+ excluded 'metrics' returns -1 for 'totalCost' and 'latency'.required: falseschema:type: string@@ -4686,6 +4828,178 @@ components:- userId- queueId- projectId+ BlobStorageIntegrationType:+ title: BlobStorageIntegrationType+ type: string+ enum:+ - S3+ - S3_COMPATIBLE+ - AZURE_BLOB_STORAGE+ BlobStorageIntegrationFileType:+ title: BlobStorageIntegrationFileType+ type: string+ enum:+ - JSON+ - CSV+ - JSONL+ BlobStorageExportMode:+ title: BlobStorageExportMode+ type: string+ enum:+ - FULL_HISTORY+ - FROM_TODAY+ - FROM_CUSTOM_DATE+ BlobStorageExportFrequency:+ title: BlobStorageExportFrequency+ type: string+ enum:+ - hourly+ - daily+ - weekly+ CreateBlobStorageIntegrationRequest:+ title: CreateBlobStorageIntegrationRequest+ type: object+ properties:+ projectId:+ type: string+ description: ID of the project in which to configure the blob storage integration+ type:+ $ref: '#/components/schemas/BlobStorageIntegrationType'+ bucketName:+ type: string+ description: Name of the storage bucket+ endpoint:+ type: string+ nullable: true+ description: Custom endpoint URL (required for S3_COMPATIBLE type)+ region:+ type: string+ description: Storage region+ accessKeyId:+ type: string+ nullable: true+ description: Access key ID for authentication+ secretAccessKey:+ type: string+ nullable: true+ description: Secret access key for authentication (will be encrypted when stored)+ prefix:+ type: string+ nullable: true+ description: >-+ Path prefix for exported files (must end with forward slash if+ provided)+ exportFrequency:+ $ref: '#/components/schemas/BlobStorageExportFrequency'+ enabled:+ type: boolean+ description: Whether the integration is active+ forcePathStyle:+ type: boolean+ description: Use path-style URLs for S3 requests+ fileType:+ $ref: '#/components/schemas/BlobStorageIntegrationFileType'+ exportMode:+ $ref: '#/components/schemas/BlobStorageExportMode'+ exportStartDate:+ type: string+ format: date-time+ nullable: true+ description: >-+ Custom start date for exports (required when exportMode is+ FROM_CUSTOM_DATE)+ required:+ - projectId+ - type+ - bucketName+ - region+ - exportFrequency+ - enabled+ - forcePathStyle+ - fileType+ - exportMode+ BlobStorageIntegrationResponse:+ title: BlobStorageIntegrationResponse+ type: object+ properties:+ id:+ type: string+ projectId:+ type: string+ type:+ $ref: '#/components/schemas/BlobStorageIntegrationType'+ bucketName:+ type: string+ endpoint:+ type: string+ nullable: true+ region:+ type: string+ accessKeyId:+ type: string+ nullable: true+ prefix:+ type: string+ exportFrequency:+ $ref: '#/components/schemas/BlobStorageExportFrequency'+ enabled:+ type: boolean+ forcePathStyle:+ type: boolean+ fileType:+ $ref: '#/components/schemas/BlobStorageIntegrationFileType'+ exportMode:+ $ref: '#/components/schemas/BlobStorageExportMode'+ exportStartDate:+ type: string+ format: date-time+ nullable: true+ nextSyncAt:+ type: string+ format: date-time+ nullable: true+ lastSyncAt:+ type: string+ format: date-time+ nullable: true+ createdAt:+ type: string+ format: date-time+ updatedAt:+ type: string+ format: date-time+ required:+ - id+ - projectId+ - type+ - bucketName+ - region+ - prefix+ - exportFrequency+ - enabled+ - forcePathStyle+ - fileType+ - exportMode+ - createdAt+ - updatedAt+ BlobStorageIntegrationsResponse:+ title: BlobStorageIntegrationsResponse+ type: object+ properties:+ data:+ type: array+ items:+ $ref: '#/components/schemas/BlobStorageIntegrationResponse'+ required:+ - data+ BlobStorageIntegrationDeletionResponse:+ title: BlobStorageIntegrationDeletionResponse+ type: object+ properties:+ message:+ type: string+ required:+ - messageCreateCommentRequest:title: CreateCommentRequesttype: objectdiff --git a/web/public/generated/postman/collection.json b/web/public/generated/postman/collection.jsonindex 142a365f25..052167d3d8 100644--- a/web/public/generated/postman/collection.json+++ b/web/public/generated/postman/collection.json@@ -49,8 +49,14 @@"description": "Get all annotation queues","url": {"raw": "{{baseUrl}}/api/public/annotation-queues?page=&limit=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "annotation-queues"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "annotation-queues"+ ],"query": [{"key": "page",@@ -79,8 +85,14 @@"description": "Create an annotation queue","url": {"raw": "{{baseUrl}}/api/public/annotation-queues",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "annotation-queues"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "annotation-queues"+ ],"query": [],"variable": []},@@ -106,8 +118,15 @@"description": "Get an annotation queue by ID","url": {"raw": "{{baseUrl}}/api/public/annotation-queues/:queueId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "annotation-queues", ":queueId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "annotation-queues",+ ":queueId"+ ],"query": [],"variable": [{@@ -131,7 +150,9 @@"description": "Get items for a specific annotation queue","url": {"raw": "{{baseUrl}}/api/public/annotation-queues/:queueId/items?status=&page=&limit=",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -178,7 +199,9 @@"description": "Get a specific item from an annotation queue","url": {"raw": "{{baseUrl}}/api/public/annotation-queues/:queueId/items/:itemId",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -215,7 +238,9 @@"description": "Add an item to an annotation queue","url": {"raw": "{{baseUrl}}/api/public/annotation-queues/:queueId/items",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -254,7 +279,9 @@"description": "Update an annotation queue item","url": {"raw": "{{baseUrl}}/api/public/annotation-queues/:queueId/items/:itemId",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -299,7 +326,9 @@"description": "Remove an item from an annotation queue","url": {"raw": "{{baseUrl}}/api/public/annotation-queues/:queueId/items/:itemId",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -336,7 +365,9 @@"description": "Create an assignment for a user to an annotation queue","url": {"raw": "{{baseUrl}}/api/public/annotation-queues/:queueId/assignments",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -375,7 +406,9 @@"description": "Delete an assignment for a user to an annotation queue","url": {"raw": "{{baseUrl}}/api/public/annotation-queues/:queueId/assignments",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -409,6 +442,106 @@}]},+ {+ "_type": "container",+ "description": null,+ "name": "Blob Storage Integrations",+ "item": [+ {+ "_type": "endpoint",+ "name": "Get Blob Storage Integrations",+ "request": {+ "description": "Get all blob storage integrations for the organization (requires organization-scoped API key)",+ "url": {+ "raw": "{{baseUrl}}/api/public/integrations/blob-storage",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "integrations",+ "blob-storage"+ ],+ "query": [],+ "variable": []+ },+ "header": [],+ "method": "GET",+ "auth": null,+ "body": null+ },+ "response": []+ },+ {+ "_type": "endpoint",+ "name": "Upsert Blob Storage Integration",+ "request": {+ "description": "Create or update a blob storage integration for a specific project (requires organization-scoped API key). The configuration is validated by performing a test upload to the bucket.",+ "url": {+ "raw": "{{baseUrl}}/api/public/integrations/blob-storage",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "integrations",+ "blob-storage"+ ],+ "query": [],+ "variable": []+ },+ "header": [],+ "method": "PUT",+ "auth": null,+ "body": {+ "mode": "raw",+ "raw": "{\n \"projectId\": \"example\",\n \"type\": \"S3\",\n \"bucketName\": \"example\",\n \"endpoint\": \"example\",\n \"region\": \"example\",\n \"accessKeyId\": \"example\",\n \"secretAccessKey\": \"example\",\n \"prefix\": \"example\",\n \"exportFrequency\": \"hourly\",\n \"enabled\": true,\n \"forcePathStyle\": true,\n \"fileType\": \"JSON\",\n \"exportMode\": \"FULL_HISTORY\",\n \"exportStartDate\": \"1994-11-05T13:15:30Z\"\n}",+ "options": {+ "raw": {+ "language": "json"+ }+ }+ }+ },+ "response": []+ },+ {+ "_type": "endpoint",+ "name": "Delete Blob Storage Integration",+ "request": {+ "description": "Delete a blob storage integration by ID (requires organization-scoped API key)",+ "url": {+ "raw": "{{baseUrl}}/api/public/integrations/blob-storage/:id",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "integrations",+ "blob-storage",+ ":id"+ ],+ "query": [],+ "variable": [+ {+ "key": "id",+ "value": "",+ "description": null+ }+ ]+ },+ "header": [],+ "method": "DELETE",+ "auth": null,+ "body": null+ },+ "response": []+ }+ ]+ },{"_type": "container","description": null,@@ -421,8 +554,14 @@"description": "Create a comment. Comments may be attached to different object types (trace, observation, session, prompt).","url": {"raw": "{{baseUrl}}/api/public/comments",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "comments"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "comments"+ ],"query": [],"variable": []},@@ -448,8 +587,14 @@"description": "Get all comments","url": {"raw": "{{baseUrl}}/api/public/comments?page=&limit=&objectType=&objectId=&authorUserId=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "comments"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "comments"+ ],"query": [{"key": "page",@@ -493,8 +638,15 @@"description": "Get a comment by id","url": {"raw": "{{baseUrl}}/api/public/comments/:commentId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "comments", ":commentId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "comments",+ ":commentId"+ ],"query": [],"variable": [{@@ -525,8 +677,14 @@"description": "Create a dataset item","url": {"raw": "{{baseUrl}}/api/public/dataset-items",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "dataset-items"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "dataset-items"+ ],"query": [],"variable": []},@@ -552,8 +710,15 @@"description": "Get a dataset item","url": {"raw": "{{baseUrl}}/api/public/dataset-items/:id",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "dataset-items", ":id"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "dataset-items",+ ":id"+ ],"query": [],"variable": [{@@ -577,8 +742,14 @@"description": "Get dataset items","url": {"raw": "{{baseUrl}}/api/public/dataset-items?datasetName=&sourceTraceId=&sourceObservationId=&page=&limit=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "dataset-items"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "dataset-items"+ ],"query": [{"key": "datasetName",@@ -622,8 +793,15 @@"description": "Delete a dataset item and all its run items. This action is irreversible.","url": {"raw": "{{baseUrl}}/api/public/dataset-items/:id",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "dataset-items", ":id"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "dataset-items",+ ":id"+ ],"query": [],"variable": [{@@ -654,8 +832,14 @@"description": "Create a dataset run item","url": {"raw": "{{baseUrl}}/api/public/dataset-run-items",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "dataset-run-items"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "dataset-run-items"+ ],"query": [],"variable": []},@@ -681,8 +865,14 @@"description": "List dataset run items","url": {"raw": "{{baseUrl}}/api/public/dataset-run-items?datasetId=&runName=&page=&limit=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "dataset-run-items"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "dataset-run-items"+ ],"query": [{"key": "datasetId",@@ -728,8 +918,15 @@"description": "Get all datasets","url": {"raw": "{{baseUrl}}/api/public/v2/datasets?page=&limit=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "v2", "datasets"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "v2",+ "datasets"+ ],"query": [{"key": "page",@@ -758,8 +955,16 @@"description": "Get a dataset","url": {"raw": "{{baseUrl}}/api/public/v2/datasets/:datasetName",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "v2", "datasets", ":datasetName"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "v2",+ "datasets",+ ":datasetName"+ ],"query": [],"variable": [{@@ -783,8 +988,15 @@"description": "Create a dataset","url": {"raw": "{{baseUrl}}/api/public/v2/datasets",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "v2", "datasets"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "v2",+ "datasets"+ ],"query": [],"variable": []},@@ -810,7 +1022,9 @@"description": "Get a dataset run and its items","url": {"raw": "{{baseUrl}}/api/public/datasets/:datasetName/runs/:runName",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -847,7 +1061,9 @@"description": "Delete a dataset run and all its run items. This action is irreversible.","url": {"raw": "{{baseUrl}}/api/public/datasets/:datasetName/runs/:runName",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -884,8 +1100,16 @@"description": "Get dataset runs","url": {"raw": "{{baseUrl}}/api/public/datasets/:datasetName/runs?page=&limit=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "datasets", ":datasetName", "runs"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "datasets",+ ":datasetName",+ "runs"+ ],"query": [{"key": "page",@@ -927,8 +1151,14 @@"description": "Check health of API and database","url": {"raw": "{{baseUrl}}/api/public/health",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "health"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "health"+ ],"query": [],"variable": []},@@ -950,11 +1180,17 @@"_type": "endpoint","name": "Batch","request": {- "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n- Introduction to data model: https://langfuse.com/docs/tracing-data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors.",+ "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n- Introduction to data model: https://langfuse.com/docs/observability/data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors.","url": {"raw": "{{baseUrl}}/api/public/ingestion",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "ingestion"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "ingestion"+ ],"query": [],"variable": []},@@ -983,11 +1219,17 @@"status": "OK","code": 200,"originalRequest": {- "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n- Introduction to data model: https://langfuse.com/docs/tracing-data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors.",+ "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n- Introduction to data model: https://langfuse.com/docs/observability/data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors.","url": {"raw": "{{baseUrl}}/api/public/ingestion",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "ingestion"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "ingestion"+ ],"query": [],"variable": []},@@ -1019,11 +1261,17 @@"status": "OK","code": 200,"originalRequest": {- "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n- Introduction to data model: https://langfuse.com/docs/tracing-data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors.",+ "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n- Introduction to data model: https://langfuse.com/docs/observability/data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors.","url": {"raw": "{{baseUrl}}/api/public/ingestion",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "ingestion"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "ingestion"+ ],"query": [],"variable": []},@@ -1055,11 +1303,17 @@"status": "OK","code": 200,"originalRequest": {- "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n- Introduction to data model: https://langfuse.com/docs/tracing-data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors.",+ "description": "Batched ingestion for Langfuse Tracing.\nIf you want to use tracing via the API, such as to build your own Langfuse client implementation, this is the only API route you need to implement.\n\nWithin each batch, there can be multiple events.\nEach event has a type, an id, a timestamp, metadata and a body.\nInternally, we refer to this as the \"event envelope\" as it tells us something about the event but not the trace.\nWe use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request.\nThe event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App.\nI.e. if you want to update a trace, you'd use the same body id, but separate event IDs.\n\nNotes:\n- Introduction to data model: https://langfuse.com/docs/observability/data-model\n- Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly.\n- The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors.","url": {"raw": "{{baseUrl}}/api/public/ingestion",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "ingestion"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "ingestion"+ ],"query": [],"variable": []},@@ -1102,8 +1356,14 @@"description": "Get all LLM connections in a project","url": {"raw": "{{baseUrl}}/api/public/llm-connections?page=&limit=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "llm-connections"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "llm-connections"+ ],"query": [{"key": "page",@@ -1132,8 +1392,14 @@"description": "Create or update an LLM connection. The connection is upserted on provider.","url": {"raw": "{{baseUrl}}/api/public/llm-connections",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "llm-connections"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "llm-connections"+ ],"query": [],"variable": []},@@ -1166,8 +1432,15 @@"description": "Get a media record","url": {"raw": "{{baseUrl}}/api/public/media/:mediaId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "media", ":mediaId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "media",+ ":mediaId"+ ],"query": [],"variable": [{@@ -1191,8 +1464,15 @@"description": "Patch a media record","url": {"raw": "{{baseUrl}}/api/public/media/:mediaId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "media", ":mediaId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "media",+ ":mediaId"+ ],"query": [],"variable": [{@@ -1224,8 +1504,14 @@"description": "Get a presigned upload URL for a media record","url": {"raw": "{{baseUrl}}/api/public/media",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "media"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "media"+ ],"query": [],"variable": []},@@ -1258,8 +1544,14 @@"description": "Get metrics from the Langfuse project using a query object","url": {"raw": "{{baseUrl}}/api/public/metrics?query=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "metrics"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "metrics"+ ],"query": [{"key": "query",@@ -1290,8 +1582,14 @@"description": "Create a model","url": {"raw": "{{baseUrl}}/api/public/models",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "models"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "models"+ ],"query": [],"variable": []},@@ -1317,8 +1615,14 @@"description": "Get all models","url": {"raw": "{{baseUrl}}/api/public/models?page=&limit=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "models"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "models"+ ],"query": [{"key": "page",@@ -1347,8 +1651,15 @@"description": "Get a model","url": {"raw": "{{baseUrl}}/api/public/models/:id",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "models", ":id"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "models",+ ":id"+ ],"query": [],"variable": [{@@ -1372,8 +1683,15 @@"description": "Delete a model. Cannot delete models managed by Langfuse. You can create your own definition with the same modelName to override the definition though.","url": {"raw": "{{baseUrl}}/api/public/models/:id",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "models", ":id"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "models",+ ":id"+ ],"query": [],"variable": [{@@ -1404,8 +1722,15 @@"description": "Get a observation","url": {"raw": "{{baseUrl}}/api/public/observations/:observationId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "observations", ":observationId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "observations",+ ":observationId"+ ],"query": [],"variable": [{@@ -1429,8 +1754,14 @@"description": "Get a list of observations","url": {"raw": "{{baseUrl}}/api/public/observations?page=&limit=&name=&userId=&type=&traceId=&level=&parentObservationId=&environment=&fromStartTime=&toStartTime=&version=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "observations"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "observations"+ ],"query": [{"key": "page",@@ -1516,8 +1847,15 @@"description": "Get all memberships for the organization associated with the API key (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/organizations/memberships",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "organizations", "memberships"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "organizations",+ "memberships"+ ],"query": [],"variable": []},@@ -1535,8 +1873,15 @@"description": "Create or update a membership for the organization associated with the API key (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/organizations/memberships",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "organizations", "memberships"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "organizations",+ "memberships"+ ],"query": [],"variable": []},@@ -1596,7 +1941,9 @@"description": "Get all memberships for a specific project (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/projects/:projectId/memberships",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -1627,7 +1974,9 @@"description": "Create or update a membership for a specific project (requires organization-scoped API key). The user must already be a member of the organization.","url": {"raw": "{{baseUrl}}/api/public/projects/:projectId/memberships",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -1707,8 +2056,15 @@"description": "Get all projects for the organization associated with the API key (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/organizations/projects",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "organizations", "projects"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "organizations",+ "projects"+ ],"query": [],"variable": []},@@ -1733,8 +2089,14 @@"description": "Get Project associated with API key","url": {"raw": "{{baseUrl}}/api/public/projects",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "projects"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "projects"+ ],"query": [],"variable": []},@@ -1752,8 +2114,14 @@"description": "Create a new project (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/projects",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "projects"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "projects"+ ],"query": [],"variable": []},@@ -1779,8 +2147,15 @@"description": "Update a project by ID (requires organization-scoped API key).","url": {"raw": "{{baseUrl}}/api/public/projects/:projectId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "projects", ":projectId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "projects",+ ":projectId"+ ],"query": [],"variable": [{@@ -1812,8 +2187,15 @@"description": "Delete a project by ID (requires organization-scoped API key). Project deletion is processed asynchronously.","url": {"raw": "{{baseUrl}}/api/public/projects/:projectId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "projects", ":projectId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "projects",+ ":projectId"+ ],"query": [],"variable": [{@@ -1837,8 +2219,16 @@"description": "Get all API keys for a project (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/projects/:projectId/apiKeys",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "projects", ":projectId", "apiKeys"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "projects",+ ":projectId",+ "apiKeys"+ ],"query": [],"variable": [{@@ -1862,8 +2252,16 @@"description": "Create a new API key for a project (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/projects/:projectId/apiKeys",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "projects", ":projectId", "apiKeys"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "projects",+ ":projectId",+ "apiKeys"+ ],"query": [],"variable": [{@@ -1895,7 +2293,9 @@"description": "Delete an API key for a project (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/projects/:projectId/apiKeys/:apiKeyId",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -1939,7 +2339,9 @@"description": "Update labels for a specific prompt version","url": {"raw": "{{baseUrl}}/api/public/v2/prompts/:name/versions/:version",- "host": ["{{baseUrl}}"],+ "host": [+ "{{baseUrl}}"+ ],"path": ["api","public",@@ -1992,8 +2394,16 @@"description": "Get a prompt","url": {"raw": "{{baseUrl}}/api/public/v2/prompts/:promptName?version=&label=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "v2", "prompts", ":promptName"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "v2",+ "prompts",+ ":promptName"+ ],"query": [{"key": "version",@@ -2028,8 +2438,15 @@"description": "Get a list of prompt names with versions and labels","url": {"raw": "{{baseUrl}}/api/public/v2/prompts?name=&label=&tag=&page=&limit=&fromUpdatedAt=&toUpdatedAt=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "v2", "prompts"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "v2",+ "prompts"+ ],"query": [{"key": "name",@@ -2083,8 +2500,15 @@"description": "Create a new version for the prompt with the given `name`","url": {"raw": "{{baseUrl}}/api/public/v2/prompts",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "v2", "prompts"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "v2",+ "prompts"+ ],"query": [],"variable": []},@@ -2117,8 +2541,15 @@"description": "Get SCIM Service Provider Configuration (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/scim/ServiceProviderConfig",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "scim", "ServiceProviderConfig"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "scim",+ "ServiceProviderConfig"+ ],"query": [],"variable": []},@@ -2136,8 +2567,15 @@"description": "Get SCIM Resource Types (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/scim/ResourceTypes",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "scim", "ResourceTypes"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "scim",+ "ResourceTypes"+ ],"query": [],"variable": []},@@ -2155,8 +2593,15 @@"description": "Get SCIM Schemas (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/scim/Schemas",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "scim", "Schemas"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "scim",+ "Schemas"+ ],"query": [],"variable": []},@@ -2174,8 +2619,15 @@"description": "List users in the organization (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/scim/Users?filter=&startIndex=&count=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "scim", "Users"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "scim",+ "Users"+ ],"query": [{"key": "filter",@@ -2209,8 +2661,15 @@"description": "Create a new user in the organization (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/scim/Users",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "scim", "Users"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "scim",+ "Users"+ ],"query": [],"variable": []},@@ -2236,8 +2695,16 @@"description": "Get a specific user by ID (requires organization-scoped API key)","url": {"raw": "{{baseUrl}}/api/public/scim/Users/:userId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "scim", "Users", ":userId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "scim",+ "Users",+ ":userId"+ ],"query": [],"variable": [{@@ -2261,8 +2728,16 @@"description": "Remove a user from the organization (requires organization-scoped API key). Note that this only removes the user from the organization but does not delete the user entity itself.","url": {"raw": "{{baseUrl}}/api/public/scim/Users/:userId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "scim", "Users", ":userId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "scim",+ "Users",+ ":userId"+ ],"query": [],"variable": [{@@ -2293,8 +2768,14 @@"description": "Create a score configuration (config). Score configs are used to define the structure of scores","url": {"raw": "{{baseUrl}}/api/public/score-configs",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "score-configs"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "score-configs"+ ],"query": [],"variable": []},@@ -2320,8 +2801,14 @@"description": "Get all score configs","url": {"raw": "{{baseUrl}}/api/public/score-configs?page=&limit=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "score-configs"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "score-configs"+ ],"query": [{"key": "page",@@ -2350,8 +2837,15 @@"description": "Get a score config","url": {"raw": "{{baseUrl}}/api/public/score-configs/:configId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "score-configs", ":configId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "score-configs",+ ":configId"+ ],"query": [],"variable": [{@@ -2382,8 +2876,15 @@"description": "Get a list of scores (supports both trace and session scores)","url": {"raw": "{{baseUrl}}/api/public/v2/scores?page=&limit=&userId=&name=&fromTimestamp=&toTimestamp=&environment=&source=&operator=&value=&scoreIds=&configId=&queueId=&dataType=&traceTags=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "v2", "scores"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "v2",+ "scores"+ ],"query": [{"key": "page",@@ -2477,8 +2978,16 @@"description": "Get a score (supports both trace and session scores)","url": {"raw": "{{baseUrl}}/api/public/v2/scores/:scoreId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "v2", "scores", ":scoreId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "v2",+ "scores",+ ":scoreId"+ ],"query": [],"variable": [{@@ -2509,8 +3018,14 @@"description": "Create a score (supports both trace and session scores)","url": {"raw": "{{baseUrl}}/api/public/scores",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "scores"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "scores"+ ],"query": [],"variable": []},@@ -2536,8 +3051,15 @@"description": "Delete a score (supports both trace and session scores)","url": {"raw": "{{baseUrl}}/api/public/scores/:scoreId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "scores", ":scoreId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "scores",+ ":scoreId"+ ],"query": [],"variable": [{@@ -2568,8 +3090,14 @@"description": "Get sessions","url": {"raw": "{{baseUrl}}/api/public/sessions?page=&limit=&fromTimestamp=&toTimestamp=&environment=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "sessions"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "sessions"+ ],"query": [{"key": "page",@@ -2613,8 +3141,15 @@"description": "Get a session. Please note that `traces` on this endpoint are not paginated, if you plan to fetch large sessions, consider `GET /api/public/traces?sessionId=<sessionId>`","url": {"raw": "{{baseUrl}}/api/public/sessions/:sessionId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "sessions", ":sessionId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "sessions",+ ":sessionId"+ ],"query": [],"variable": [{@@ -2645,8 +3180,15 @@"description": "Get a specific trace","url": {"raw": "{{baseUrl}}/api/public/traces/:traceId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "traces", ":traceId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "traces",+ ":traceId"+ ],"query": [],"variable": [{@@ -2670,8 +3212,15 @@"description": "Delete a specific trace","url": {"raw": "{{baseUrl}}/api/public/traces/:traceId",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "traces", ":traceId"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "traces",+ ":traceId"+ ],"query": [],"variable": [{@@ -2695,8 +3244,14 @@"description": "Get list of traces","url": {"raw": "{{baseUrl}}/api/public/traces?page=&limit=&userId=&name=&sessionId=&fromTimestamp=&toTimestamp=&orderBy=&tags=&version=&release=&environment=&fields=",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "traces"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "traces"+ ],"query": [{"key": "page",@@ -2761,7 +3316,7 @@{"key": "fields","value": "",- "description": "Comma-separated list of fields to include in the response. Available field groups are 'core' (always included), 'io' (input, output, metadata), 'scores', 'observations', 'metrics'. If not provided, all fields are included. Example: 'core,scores,metrics'"+ "description": "Comma-separated list of fields to include in the response. Available field groups: 'core' (always included), 'io' (input, output, metadata), 'scores', 'observations', 'metrics'. If not specified, all fields are returned. Example: 'core,scores,metrics'. Note: Excluded 'observations' or 'scores' fields return empty arrays; excluded 'metrics' returns -1 for 'totalCost' and 'latency'."}],"variable": []@@ -2780,8 +3335,14 @@"description": "Delete multiple traces","url": {"raw": "{{baseUrl}}/api/public/traces",- "host": ["{{baseUrl}}"],- "path": ["api", "public", "traces"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "api",+ "public",+ "traces"+ ],"query": [],"variable": []},@@ -2803,4 +3364,4 @@]}]-}+}\ No newline at end of filediff --git a/web/src/__tests__/async/blob-storage-integration-api.servertest.ts b/web/src/__tests__/async/blob-storage-integration-api.servertest.tsnew file mode 100644index 0000000000..64d4d9a745--- /dev/null+++ b/web/src/__tests__/async/blob-storage-integration-api.servertest.ts@@ -0,0 +1,619 @@+/** @jest-environment node */++import {+ makeZodVerifiedAPICall,+ makeAPICall,+} from "@/src/__tests__/test-utils";+import { prisma } from "@langfuse/shared/src/db";+import { z } from "zod/v4";+import { randomUUID } from "crypto";+import {+ createAndAddApiKeysToDb,+ createBasicAuthHeader,+} from "@langfuse/shared/src/server";++// Schemas based on Fern schema definition+const BlobStorageIntegrationResponseSchema = z.object({+ id: z.string(),+ projectId: z.string(),+ type: z.enum(["S3", "S3_COMPATIBLE", "AZURE_BLOB_STORAGE"]),+ bucketName: z.string(),+ endpoint: z.string().nullable(),+ region: z.string(),+ accessKeyId: z.string().nullable(),+ prefix: z.string(),+ exportFrequency: z.enum(["hourly", "daily", "weekly"]),+ enabled: z.boolean(),+ forcePathStyle: z.boolean(),+ fileType: z.enum(["JSON", "CSV", "JSONL"]),+ exportMode: z.enum(["FULL_HISTORY", "FROM_TODAY", "FROM_CUSTOM_DATE"]),+ exportStartDate: z.coerce.date().nullable(),+ nextSyncAt: z.coerce.date().nullable(),+ lastSyncAt: z.coerce.date().nullable(),+ createdAt: z.coerce.date(),+ updatedAt: z.coerce.date(),+});++const BlobStorageIntegrationsResponseSchema = z.object({+ data: z.array(BlobStorageIntegrationResponseSchema),+});++const BlobStorageIntegrationDeletionResponseSchema = z.object({+ message: z.string(),+});++// Valid blob storage integration request payload+const validBlobStorageConfig = {+ projectId: "",+ type: "S3" as const,+ bucketName: "test-bucket",+ endpoint: null,+ region: "us-east-1",+ accessKeyId: "AKIA123456789",+ secretAccessKey: "secret123456789",+ prefix: "langfuse-exports/",+ exportFrequency: "daily" as const,+ enabled: true,+ forcePathStyle: false,+ fileType: "JSONL" as const,+ exportMode: "FULL_HISTORY" as const,+ exportStartDate: null,+};++describe("Blob Storage Integrations API", () => {+ // Test data+ let testOrgId: string;+ let testProject1Id: string;+ let testProject2Id: string;+ let testApiKey: string;+ let testApiSecretKey: string;+ let otherOrgId: string;+ let otherProjectId: string;++ beforeAll(async () => {+ // Create test organization+ const testOrg = await prisma.organization.create({+ data: {+ name: `Blob Storage Test Org ${randomUUID().substring(0, 8)}`,+ cloudConfig: { plan: "Team" },+ },+ });+ testOrgId = testOrg.id;++ // Create test projects+ const testProject1 = await prisma.project.create({+ data: {+ name: `Blob Storage Test Project 1 ${randomUUID().substring(0, 8)}`,+ orgId: testOrgId,+ },+ });+ testProject1Id = testProject1.id;++ const testProject2 = await prisma.project.create({+ data: {+ name: `Blob Storage Test Project 2 ${randomUUID().substring(0, 8)}`,+ orgId: testOrgId,+ },+ });+ testProject2Id = testProject2.id;++ // Create organization API key+ const orgApiKey = await createAndAddApiKeysToDb({+ prisma,+ entityId: testOrgId,+ scope: "ORGANIZATION",+ note: "Test API Key for Blob Storage API",+ predefinedKeys: {+ publicKey: `pk-lf-blob-${randomUUID().substring(0, 8)}`,+ secretKey: `sk-lf-blob-${randomUUID().substring(0, 8)}`,+ },+ });+ testApiKey = orgApiKey.publicKey;+ testApiSecretKey = orgApiKey.secretKey;++ // Create another organization for cross-org tests+ const otherOrg = await prisma.organization.create({+ data: {+ name: `Other Blob Storage Org ${randomUUID().substring(0, 8)}`,+ cloudConfig: { plan: "Team" },+ },+ });+ otherOrgId = otherOrg.id;++ const otherProject = await prisma.project.create({+ data: {+ name: `Other Blob Storage Project ${randomUUID().substring(0, 8)}`,+ orgId: otherOrgId,+ },+ });+ otherProjectId = otherProject.id;+ });++ afterAll(async () => {+ // Clean up test data+ await prisma.organization.delete({+ where: { id: testOrgId },+ });+ await prisma.organization.delete({+ where: { id: otherOrgId },+ });+ });++ describe("GET /api/public/integrations/blob-storage", () => {+ let testIntegrationId: string;++ beforeAll(async () => {+ // Create a test blob storage integration+ const integration = await prisma.blobStorageIntegration.create({+ data: {+ projectId: testProject1Id,+ type: "S3",+ bucketName: "test-bucket",+ region: "us-east-1",+ accessKeyId: "test-access-key",+ secretAccessKey: "encrypted-secret",+ prefix: "langfuse-exports/",+ exportFrequency: "daily",+ enabled: true,+ forcePathStyle: false,+ fileType: "JSONL",+ exportMode: "FULL_HISTORY",+ },+ });+ testIntegrationId = integration.projectId;+ });++ afterAll(async () => {+ // Clean up test integration+ await prisma.blobStorageIntegration.deleteMany({+ where: { projectId: testProject1Id },+ });+ });++ it("should get all blob storage integrations for the organization", async () => {+ const response = await makeZodVerifiedAPICall(+ BlobStorageIntegrationsResponseSchema,+ "GET",+ "/api/public/integrations/blob-storage",+ undefined,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ 200,+ );++ expect(response.status).toBe(200);+ expect(Array.isArray(response.body.data)).toBe(true);+ expect(response.body.data.length).toBe(1);++ const integration = response.body.data.find(+ (i) => i.id === testIntegrationId,+ );+ expect(integration).toBeDefined();+ expect(integration?.projectId).toBe(testProject1Id);+ expect(integration?.type).toBe("S3");+ expect(integration?.bucketName).toBe("test-bucket");+ expect(integration?.accessKeyId).toBe("test-access-key");+ // Verify that secretAccessKey is not returned+ expect(integration).not.toHaveProperty("secretAccessKey");+ });++ it("should return 401 with invalid API key", async () => {+ const result = await makeAPICall(+ "GET",+ "/api/public/integrations/blob-storage",+ undefined,+ createBasicAuthHeader("invalid-key", "invalid-secret"),+ );+ expect(result.status).toBe(401);+ });++ it("should return 403 with project-scoped API key", async () => {+ // Create project API key+ const projectApiKey = await createAndAddApiKeysToDb({+ prisma,+ entityId: testProject1Id,+ scope: "PROJECT",+ note: "Project API Key",+ predefinedKeys: {+ publicKey: `pk-lf-proj-${randomUUID().substring(0, 8)}`,+ secretKey: `sk-lf-proj-${randomUUID().substring(0, 8)}`,+ },+ });++ const result = await makeAPICall(+ "GET",+ "/api/public/integrations/blob-storage",+ undefined,+ createBasicAuthHeader(projectApiKey.publicKey, projectApiKey.secretKey),+ );+ expect(result.status).toBe(403);+ expect(result.body.message).toContain(+ "Organization-scoped API key required",+ );++ // Clean up+ await prisma.apiKey.delete({ where: { id: projectApiKey.id } });+ });+ });++ describe("PUT /api/public/integrations/blob-storage", () => {+ afterEach(async () => {+ // Clean up any created integrations+ await prisma.blobStorageIntegration.deleteMany({+ where: {+ projectId: {+ in: [testProject1Id, testProject2Id],+ },+ },+ });+ });++ it("should create a new blob storage integration", async () => {+ const requestBody = {+ ...validBlobStorageConfig,+ projectId: testProject1Id,+ };++ const response = await makeZodVerifiedAPICall(+ BlobStorageIntegrationResponseSchema,+ "PUT",+ "/api/public/integrations/blob-storage",+ requestBody,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ );++ expect(response.status).toBe(200);+ expect(response.body.projectId).toBe(testProject1Id);+ expect(response.body.type).toBe("S3");+ expect(response.body.bucketName).toBe("test-bucket");+ expect(response.body.enabled).toBe(true);+ // Verify secretAccessKey is not returned+ expect(response.body).not.toHaveProperty("secretAccessKey");++ // Verify it was saved to database+ const savedIntegration = await prisma.blobStorageIntegration.findUnique({+ where: { projectId: testProject1Id },+ });+ expect(savedIntegration).toBeDefined();+ expect(savedIntegration?.bucketName).toBe("test-bucket");+ });++ it("should update an existing blob storage integration", async () => {+ // Create initial integration+ await prisma.blobStorageIntegration.create({+ data: {+ projectId: testProject1Id,+ type: "S3",+ bucketName: "old-bucket",+ region: "us-west-1",+ accessKeyId: "old-key",+ secretAccessKey: "old-secret",+ prefix: "old-prefix/",+ exportFrequency: "hourly",+ enabled: false,+ forcePathStyle: true,+ fileType: "JSON",+ exportMode: "FROM_TODAY",+ },+ });++ const updateBody = {+ ...validBlobStorageConfig,+ projectId: testProject1Id,+ bucketName: "updated-bucket",+ enabled: true,+ exportFrequency: "weekly" as const,+ };++ const response = await makeZodVerifiedAPICall(+ BlobStorageIntegrationResponseSchema,+ "PUT",+ "/api/public/integrations/blob-storage",+ updateBody,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ 200,+ );++ expect(response.status).toBe(200);+ expect(response.body.bucketName).toBe("updated-bucket");+ expect(response.body.enabled).toBe(true);+ expect(response.body.exportFrequency).toBe("weekly");+ });++ it("should validate required fields", async () => {+ const invalidBody = {+ projectId: testProject1Id,+ type: "S3",+ // Missing bucketName+ region: "us-east-1",+ };++ const result = await makeAPICall(+ "PUT",+ "/api/public/integrations/blob-storage",+ invalidBody,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ );+ expect(result.status).toBe(400);+ expect(result.body.message).toContain("Invalid request data");+ });++ it("should validate enum values", async () => {+ const invalidBody = {+ ...validBlobStorageConfig,+ projectId: testProject1Id,+ type: "INVALID_TYPE",+ };++ const result = await makeAPICall(+ "PUT",+ "/api/public/integrations/blob-storage",+ invalidBody,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ );+ expect(result.status).toBe(400);+ expect(result.body.message).toContain("Invalid request data");+ });++ it("should validate prefix format", async () => {+ const invalidBody = {+ ...validBlobStorageConfig,+ projectId: testProject1Id,+ prefix: "invalid-prefix", // Should end with /+ };++ const result = await makeAPICall(+ "PUT",+ "/api/public/integrations/blob-storage",+ invalidBody,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ );+ expect(result.status).toBe(400);+ expect(result.body.error).toBeDefined();+ });++ it("should return 404 for non-existent project", async () => {+ const nonExistentProjectId = randomUUID();+ const requestBody = {+ ...validBlobStorageConfig,+ projectId: nonExistentProjectId,+ };++ const result = await makeAPICall(+ "PUT",+ "/api/public/integrations/blob-storage",+ requestBody,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ );+ expect(result.status).toBe(404);+ expect(result.body.message).toContain("Project not found");+ });++ it("should return 404 for project from different organization", async () => {+ const requestBody = {+ ...validBlobStorageConfig,+ projectId: otherProjectId,+ };++ const result = await makeAPICall(+ "PUT",+ "/api/public/integrations/blob-storage",+ requestBody,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ );+ expect(result.status).toBe(404);+ expect(result.body.message).toContain("Project not found");+ });++ it("should return 401 with invalid API key", async () => {+ const requestBody = {+ ...validBlobStorageConfig,+ projectId: testProject1Id,+ };++ const result = await makeAPICall(+ "PUT",+ "/api/public/integrations/blob-storage",+ requestBody,+ createBasicAuthHeader("invalid-key", "invalid-secret"),+ );+ expect(result.status).toBe(401);+ });++ it("should handle different blob storage types", async () => {+ const azureConfig = {+ ...validBlobStorageConfig,+ projectId: testProject1Id,+ type: "AZURE_BLOB_STORAGE" as const,+ endpoint: "https://myaccount.blob.core.windows.net",+ };++ const response = await makeZodVerifiedAPICall(+ BlobStorageIntegrationResponseSchema,+ "PUT",+ "/api/public/integrations/blob-storage",+ azureConfig,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ 200,+ );++ expect(response.status).toBe(200);+ expect(response.body.type).toBe("AZURE_BLOB_STORAGE");+ expect(response.body.endpoint).toBe(+ "https://myaccount.blob.core.windows.net",+ );+ });++ it("should handle export modes with dates", async () => {+ const customDateConfig = {+ ...validBlobStorageConfig,+ projectId: testProject1Id,+ exportMode: "FROM_CUSTOM_DATE" as const,+ exportStartDate: "2024-01-01T00:00:00Z",+ };++ const response = await makeZodVerifiedAPICall(+ BlobStorageIntegrationResponseSchema,+ "PUT",+ "/api/public/integrations/blob-storage",+ customDateConfig,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ 200,+ );++ expect(response.status).toBe(200);+ expect(response.body.exportMode).toBe("FROM_CUSTOM_DATE");+ expect(response.body.exportStartDate).toBeDefined();+ });+ });++ describe("DELETE /api/public/integrations/blob-storage/{id}", () => {+ let testIntegrationId: string;++ beforeEach(async () => {+ // Create test integration+ const integration = await prisma.blobStorageIntegration.create({+ data: {+ projectId: testProject1Id,+ type: "S3",+ bucketName: "test-bucket",+ region: "us-east-1",+ accessKeyId: "test-key",+ secretAccessKey: "test-secret",+ prefix: "test/",+ exportFrequency: "daily",+ enabled: true,+ forcePathStyle: false,+ fileType: "JSONL",+ exportMode: "FULL_HISTORY",+ },+ });+ testIntegrationId = integration.projectId; // Based on current implementation, ID is projectId+ });++ afterEach(async () => {+ // Clean up+ await prisma.blobStorageIntegration.deleteMany({+ where: { projectId: testProject1Id },+ });+ });++ it("should delete a blob storage integration", async () => {+ const response = await makeZodVerifiedAPICall(+ BlobStorageIntegrationDeletionResponseSchema,+ "DELETE",+ `/api/public/integrations/blob-storage/${testIntegrationId}`,+ undefined,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ 200,+ );++ expect(response.status).toBe(200);+ expect(response.body.message).toBeDefined();++ // Verify it was deleted from database+ const deletedIntegration = await prisma.blobStorageIntegration.findUnique(+ {+ where: { projectId: testIntegrationId },+ },+ );+ expect(deletedIntegration).toBeNull();+ });++ it("should return 404 for non-existent integration", async () => {+ const nonExistentId = randomUUID();+ const result = await makeAPICall(+ "DELETE",+ `/api/public/integrations/blob-storage/${nonExistentId}`,+ undefined,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ );+ expect(result.status).toBe(404);+ });++ it("should return 404 for integration from different organization", async () => {+ // Create integration in other org+ const otherOrgIntegration = await prisma.blobStorageIntegration.create({+ data: {+ projectId: otherProjectId,+ type: "S3",+ bucketName: "other-bucket",+ region: "us-east-1",+ accessKeyId: "other-key",+ secretAccessKey: "other-secret",+ prefix: "other/",+ exportFrequency: "daily",+ enabled: true,+ forcePathStyle: false,+ fileType: "JSONL",+ exportMode: "FULL_HISTORY",+ },+ });++ const result = await makeAPICall(+ "DELETE",+ `/api/public/integrations/blob-storage/${otherOrgIntegration.projectId}`,+ undefined,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ );+ expect(result.status).toBe(404);++ // Check config still exists+ const integrations = await prisma.blobStorageIntegration.findMany({+ where: { projectId: otherProjectId },+ });+ expect(integrations).toHaveLength(1);++ // Clean up+ await prisma.blobStorageIntegration.delete({+ where: { projectId: otherProjectId },+ });+ });++ it("should return 401 with invalid API key", async () => {+ const result = await makeAPICall(+ "DELETE",+ `/api/public/integrations/blob-storage/${testIntegrationId}`,+ undefined,+ createBasicAuthHeader("invalid-key", "invalid-secret"),+ );+ expect(result.status).toBe(401);+ });++ it("should return 403 with project-scoped API key", async () => {+ const projectApiKey = await createAndAddApiKeysToDb({+ prisma,+ entityId: testProject1Id,+ scope: "PROJECT",+ note: "Project API Key",+ predefinedKeys: {+ publicKey: `pk-lf-proj-del-${randomUUID().substring(0, 8)}`,+ secretKey: `sk-lf-proj-del-${randomUUID().substring(0, 8)}`,+ },+ });++ const result = await makeAPICall(+ "DELETE",+ `/api/public/integrations/blob-storage/${testIntegrationId}`,+ undefined,+ createBasicAuthHeader(projectApiKey.publicKey, projectApiKey.secretKey),+ );+ expect(result.status).toBe(403);++ // Clean up+ await prisma.apiKey.delete({ where: { id: projectApiKey.id } });+ });+ });++ describe("Method validation", () => {+ it("should return 405 for unsupported methods", async () => {+ const result = await makeAPICall(+ "PATCH",+ "/api/public/integrations/blob-storage",+ undefined,+ createBasicAuthHeader(testApiKey, testApiSecretKey),+ );+ expect(result.status).toBe(405);+ expect(result.body.message).toContain("Method not allowed");+ });+ });+});diff --git a/web/src/features/public-api/types/blob-storage-integrations.ts b/web/src/features/public-api/types/blob-storage-integrations.tsnew file mode 100644index 0000000000..6ce7f464f7--- /dev/null+++ b/web/src/features/public-api/types/blob-storage-integrations.ts@@ -0,0 +1,86 @@+import { z } from "zod/v4";++/**+ * Enums+ */++export const BlobStorageIntegrationType = z.enum([+ "S3",+ "S3_COMPATIBLE",+ "AZURE_BLOB_STORAGE",+]);++export const BlobStorageIntegrationFileType = z.enum(["JSON", "CSV", "JSONL"]);++export const BlobStorageExportMode = z.enum([+ "FULL_HISTORY",+ "FROM_TODAY",+ "FROM_CUSTOM_DATE",+]);++/**+ * Request/Response Types+ */++export const CreateBlobStorageIntegrationRequest = z+ .object({+ projectId: z.string(),+ type: BlobStorageIntegrationType,+ bucketName: z.string(),+ endpoint: z.string().nullable().optional(),+ region: z.string(),+ accessKeyId: z.string().nullable().optional(),+ secretAccessKey: z.string().nullable().optional(),+ prefix: z+ .string()+ .optional()+ .default("")+ .refine(+ (value) => value === "" || value.endsWith("/"),+ "Prefix must be empty or end with a forward slash",+ ),+ exportFrequency: z.string(),+ enabled: z.boolean(),+ forcePathStyle: z.boolean(),+ fileType: BlobStorageIntegrationFileType,+ exportMode: BlobStorageExportMode,+ exportStartDate: z.coerce.date().nullable().optional(),+ })+ .strict()+ .refine(+ (data) => {+ return !(data.exportMode === "FROM_CUSTOM_DATE" && !data.exportStartDate);+ },+ {+ message:+ "exportStartDate is required when exportMode is FROM_CUSTOM_DATE",+ path: ["exportStartDate"],+ },+ );++export const BlobStorageIntegrationResponse = z+ .object({+ id: z.string(),+ projectId: z.string(),+ type: BlobStorageIntegrationType,+ bucketName: z.string(),+ endpoint: z.string().nullable(),+ region: z.string(),+ accessKeyId: z.string().nullable(),+ prefix: z.string(),+ exportFrequency: z.string(),+ enabled: z.boolean(),+ forcePathStyle: z.boolean(),+ fileType: BlobStorageIntegrationFileType,+ exportMode: BlobStorageExportMode,+ exportStartDate: z.coerce.date().nullable(),+ nextSyncAt: z.coerce.date().nullable(),+ lastSyncAt: z.coerce.date().nullable(),+ createdAt: z.coerce.date(),+ updatedAt: z.coerce.date(),+ })+ .strict();++export type BlobStorageIntegrationResponseType = z.infer<+ typeof BlobStorageIntegrationResponse+>;diff --git a/web/src/pages/api/public/integrations/blob-storage/[id].ts b/web/src/pages/api/public/integrations/blob-storage/[id].tsnew file mode 100644index 0000000000..6c6da3f735--- /dev/null+++ b/web/src/pages/api/public/integrations/blob-storage/[id].ts@@ -0,0 +1,79 @@+import { ApiAuthService } from "@/src/features/public-api/server/apiAuth";+import { withMiddlewares } from "@/src/features/public-api/server/withMiddlewares";+import { prisma } from "@langfuse/shared/src/db";+import { redis } from "@langfuse/shared/src/server";+import { type NextApiRequest, type NextApiResponse } from "next";+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";+import {+ LangfuseNotFoundError,+ UnauthorizedError,+ ForbiddenError,+} from "@langfuse/shared";++export default withMiddlewares({+ DELETE: handleDeleteBlobStorageIntegration,+});++async function handleDeleteBlobStorageIntegration(+ req: NextApiRequest,+ res: NextApiResponse,+) {+ // CHECK AUTH+ const authCheck = await new ApiAuthService(+ prisma,+ redis,+ ).verifyAuthHeaderAndReturnScope(req.headers.authorization);+ if (!authCheck.validKey) {+ throw new UnauthorizedError(authCheck.error ?? "Unauthorized");+ }++ // Check if using an organization API key+ if (+ authCheck.scope.accessLevel !== "organization" ||+ !authCheck.scope.orgId+ ) {+ throw new ForbiddenError(+ "Organization-scoped API key required for this operation.",+ );+ }++ // Check scheduled-blob-exports entitlement+ if (+ !hasEntitlementBasedOnPlan({+ plan: authCheck.scope.plan,+ entitlement: "scheduled-blob-exports",+ })+ ) {+ throw new ForbiddenError(+ "scheduled-blob-exports entitlement required for this feature.",+ );+ }+ const { id } = req.query;++ if (!id || typeof id !== "string") {+ throw new Error("Invalid integration ID");+ }++ // Check if the integration exists and belongs to a project in the organization+ const integration = await prisma.blobStorageIntegration.findUnique({+ where: { projectId: id },+ include: {+ project: {+ select: { orgId: true },+ },+ },+ });++ if (!integration || integration.project.orgId !== authCheck.scope.orgId) {+ throw new LangfuseNotFoundError("Blob storage integration not found");+ }++ // Delete the integration+ await prisma.blobStorageIntegration.delete({+ where: { projectId: id },+ });++ return res.status(200).json({+ message: "Blob storage integration successfully deleted",+ });+}diff --git a/web/src/pages/api/public/integrations/blob-storage/index.ts b/web/src/pages/api/public/integrations/blob-storage/index.tsnew file mode 100644index 0000000000..695d0cfc6d--- /dev/null+++ b/web/src/pages/api/public/integrations/blob-storage/index.ts@@ -0,0 +1,194 @@+import { ApiAuthService } from "@/src/features/public-api/server/apiAuth";+import { withMiddlewares } from "@/src/features/public-api/server/withMiddlewares";+import { prisma } from "@langfuse/shared/src/db";+import { redis } from "@langfuse/shared/src/server";+import { type NextApiRequest, type NextApiResponse } from "next";+import { hasEntitlementBasedOnPlan } from "@/src/features/entitlements/server/hasEntitlement";+import {+ CreateBlobStorageIntegrationRequest,+ type BlobStorageIntegrationResponseType,+} from "@/src/features/public-api/types/blob-storage-integrations";+import {+ LangfuseNotFoundError,+ UnauthorizedError,+ ForbiddenError,+} from "@langfuse/shared";++export default withMiddlewares({+ GET: handleGetBlobStorageIntegrations,+ PUT: handleUpsertBlobStorageIntegration,+});++async function handleGetBlobStorageIntegrations(+ req: NextApiRequest,+ res: NextApiResponse,+) {+ // CHECK AUTH+ const authCheck = await new ApiAuthService(+ prisma,+ redis,+ ).verifyAuthHeaderAndReturnScope(req.headers.authorization);+ if (!authCheck.validKey) {+ throw new UnauthorizedError(authCheck.error ?? "Unauthorized");+ }++ // Check if using an organization API key+ if (+ authCheck.scope.accessLevel !== "organization" ||+ !authCheck.scope.orgId+ ) {+ throw new ForbiddenError(+ "Organization-scoped API key required for this operation.",+ );+ }++ // Check scheduled-blob-exports entitlement+ if (+ !hasEntitlementBasedOnPlan({+ plan: authCheck.scope.plan,+ entitlement: "scheduled-blob-exports",+ })+ ) {+ throw new ForbiddenError(+ "scheduled-blob-exports entitlement required for this feature.",+ );+ }++ // Get all projects for the organization+ const projects = await prisma.project.findMany({+ where: { orgId: authCheck.scope.orgId },+ select: { id: true },+ });++ // Get all blob storage integrations for these projects+ const integrations = await prisma.blobStorageIntegration.findMany({+ where: {+ projectId: { in: projects.map((p) => p.id) },+ },+ });++ // Transform to API response format, exclude secretAccessKey+ const responseData: BlobStorageIntegrationResponseType[] = integrations.map(+ (integration) => ({+ id: integration.projectId, // Using projectId as ID since it's the primary key+ projectId: integration.projectId,+ type: integration.type,+ bucketName: integration.bucketName,+ endpoint: integration.endpoint,+ region: integration.region,+ accessKeyId: integration.accessKeyId,+ prefix: integration.prefix,+ exportFrequency: integration.exportFrequency,+ enabled: integration.enabled,+ forcePathStyle: integration.forcePathStyle,+ fileType: integration.fileType,+ exportMode: integration.exportMode,+ exportStartDate: integration.exportStartDate,+ nextSyncAt: integration.nextSyncAt,+ lastSyncAt: integration.lastSyncAt,+ createdAt: integration.createdAt,+ updatedAt: integration.updatedAt,+ }),+ );++ return res.status(200).json({+ data: responseData,+ });+}++async function handleUpsertBlobStorageIntegration(+ req: NextApiRequest,+ res: NextApiResponse,+) {+ // CHECK AUTH+ const authCheck = await new ApiAuthService(+ prisma,+ redis,+ ).verifyAuthHeaderAndReturnScope(req.headers.authorization);+ if (!authCheck.validKey) {+ throw new UnauthorizedError(authCheck.error ?? "Unauthorized");+ }++ // Check if using an organization API key+ if (+ authCheck.scope.accessLevel !== "organization" ||+ !authCheck.scope.orgId+ ) {+ throw new ForbiddenError(+ "Organization-scoped API key required for this operation.",+ );+ }++ // Check scheduled-blob-exports entitlement+ if (+ !hasEntitlementBasedOnPlan({+ plan: authCheck.scope.plan,+ entitlement: "scheduled-blob-exports",+ })+ ) {+ throw new ForbiddenError(+ "scheduled-blob-exports entitlement required for this feature.",+ );+ }++ // Validate request body+ const validatedData = CreateBlobStorageIntegrationRequest.parse(req.body);++ // Check if the project exists and belongs to the organization+ const project = await prisma.project.findUnique({+ where: { id: validatedData.projectId },+ select: { id: true, orgId: true },+ });+ if (!project || project.orgId !== authCheck.scope.orgId) {+ throw new LangfuseNotFoundError("Project not found");+ }++ // Prepare data for database+ const dbData = {+ projectId: validatedData.projectId,+ type: validatedData.type,+ bucketName: validatedData.bucketName,+ endpoint: validatedData.endpoint || null,+ region: validatedData.region,+ accessKeyId: validatedData.accessKeyId || null,+ secretAccessKey: validatedData.secretAccessKey || null,+ prefix: validatedData.prefix,+ exportFrequency: validatedData.exportFrequency,+ enabled: validatedData.enabled,+ forcePathStyle: validatedData.forcePathStyle,+ fileType: validatedData.fileType,+ exportMode: validatedData.exportMode,+ exportStartDate: validatedData.exportStartDate || null,+ };++ // Upsert the integration (create or update)+ const integration = await prisma.blobStorageIntegration.upsert({+ where: { projectId: validatedData.projectId },+ update: dbData,+ create: dbData,+ });++ // Transform to API response format, exclude secretAccessKey+ const responseData: BlobStorageIntegrationResponseType = {+ id: integration.projectId, // Using projectId as ID since it's the primary key+ projectId: integration.projectId,+ type: integration.type,+ bucketName: integration.bucketName,+ endpoint: integration.endpoint,+ region: integration.region,+ accessKeyId: integration.accessKeyId,+ prefix: integration.prefix,+ exportFrequency: integration.exportFrequency,+ enabled: integration.enabled,+ forcePathStyle: integration.forcePathStyle,+ fileType: integration.fileType,+ exportMode: integration.exportMode,+ exportStartDate: integration.exportStartDate,+ nextSyncAt: integration.nextSyncAt,+ lastSyncAt: integration.lastSyncAt,+ createdAt: integration.createdAt,+ updatedAt: integration.updatedAt,+ };++ return res.status(200).json(responseData);+}