Export Workflow Usage

This endpoint exports workflow usage data including execution counts, success rates, and performance metrics. It’s only available if workflows are enabled in your workspace.

Note: This endpoint will return no data if workflows are not enabled in your workspace. Contact your workspace administrator to enable workflows if needed.

Endpoint

POST https://api.langdock.com/export/workflows

Example request (cURL)

curl --request POST \
  --url https://api.langdock.com/export/workflows \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from": {
    "date": "2024-01-01T00:00:00.000Z",
    "timezone": "UTC"
  },
  "to": {
    "date": "2024-01-31T23:59:59.999Z",
    "timezone": "UTC"
  }
}
'

Example response (200)

Description

The export contains workflow usage details such as:

  • Workflow executions

  • Success rates

  • Performance metrics

  • Error rates and types

  • Execution duration statistics

  • Resource consumption

Additional prerequisites, rate limits, and export size limits: https://docs.langdock.com/api-endpoints/usage-export/intro-to-usage-export-api

Headers

  • Authorization (string, required) API key as Bearer token with USAGE_EXPORT_API scope. Format: "Bearer YOUR_API_KEY"

Request body (application/json)

Request body for usage export endpoints

  • from (object, required) — Start date and timezone for the export

    • from.date (string, required) — Start date in ISO 8601 format Example: "2024-01-01T00:00:00.000Z"

    • from.timezone (string, required) — Timezone for the date range Example: "UTC"

  • to (object, required) — End date and timezone for the export

    • to.date (string, required) — End date in ISO 8601 format Example: "2024-01-31T23:59:59.999Z"

    • to.timezone (string, required) — Timezone for the date range Example: "UTC"

Response (200 application/json)

Successful response from usage export endpoints:

  • success (boolean, required) — Indicates if the export was successful Example: true

  • data (object, required) — Export data information

    • data.filePath (string, required) — Path to the generated export file Example: "assistants-usage/workspace-id/assistants-usage-2024-01-01-2024-01-31-abc12345.csv"

    • data.downloadUrl (string, required) — Signed URL to download the export file Example: "https://storage.example.com/signed-url"

    • data.dataType (enum, required) — Type of data exported. Available options: assistants, users, workflows, projects, models Example: "assistants"

    • data.recordCount (integer, required) — Number of records in the export Example: 1250

    • data.dateRange (object, required) — Actual date range of the exported data

      • from (string) — Export start date

      • to (string) — Export end date

Data Included

The workflow export contains:

  • Workflow executions

  • Success rates

  • Performance metrics

  • Error rates and types

  • Execution duration statistics

  • Resource consumption

For more details, see: https://docs.langdock.com/api-endpoints/usage-export/intro-to-usage-export-api

  • Export Assistant Usage: https://docs.langdock.com/api-endpoints/usage-export/export-assistants

  • Export Project Usage: https://docs.langdock.com/api-endpoints/usage-export/export-projects