Skip to main content

History API

Every offline job or streaming session lands in the History API. Use it to build dashboards, download transcripts, or share recordings with collaborators.

Permissions#

  • API
  • PIPELINE_OFFLINE_API or PIPELINE_ONLINE_API (depending on the session type)
  • Stage-specific roles (STAGE_ASR, STAGE_TTS, etc.) if you plan to resume sessions with the same user.

Endpoints at a glance#

PurposeMethod & path
List sessionsGET /api/client/sessions
Fetch a sessionGET /api/client/sessions/{sessionId}
Download audioGET /api/client/sessions/{sessionId}/audio.wav
Fetch transcriptsGET /api/client/sessions/{sessionId}/transcripts
List recordingsGET /api/client/sessions/{sessionId}/recordings
List sharesGET /api/client/sessions/{sessionId}/shares
Create sharePOST /api/client/sessions/{sessionId}/shares
Delete shareDELETE /api/client/sessions/shares/{shareId}
Discover shareable usersGET /api/client/users

All requests require an access token supplied via the Authorization: Bearer header (or ?access_token= query parameter when headers are not available).

List sessions#

curl --fail --location \n  --request GET "$TRUEBAR_API_BASE_URL/api/client/sessions" \n  --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN"

The response uses cursor-based slicing; each item includes a cursor token you can pass back in subsequent calls.

{  "cursor": "MjAyNC0wNC0yMlQwODoxNTowMC4wMDBaOjEyMzQ1",  "content": [    {      "id": 4812,      "name": "Call centre demo",      "status": "FINISHED",      "numRecordings": 2,      "recordedMs": 586000,      "processedMs": 586000,      "createdAt": "2024-04-22T08:15:30.123Z",      "updatedAt": "2024-04-22T08:27:18.044Z",      "createdByUser": "alice@example.com",      "createdByGroup": "support",      "isLocked": false,      "isDiscarded": false,      "labels": [],      "notes": null    }  ]}

Paging with cursors#

  • slice-cursor: resume from the cursor of the last session in the previous response.
  • slice-length: positive to fetch forward, negative to fetch backwards. Defaults to 20 sessions forward.

Example: fetch the next 10 sessions after the supplied cursor.

curl --request GET \  "$TRUEBAR_API_BASE_URL/api/client/sessions?slice-cursor=$CURSOR&slice-length=10" \  --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN"

Sorting & filtering#

Query parameters:

  • sort=createdAt,desc (supported fields: id, name, createdAt, updatedAt, numRecordings, recordedSeconds)
  • name=demo โ€“ substring match on the session name.
  • label=customer-a โ€“ sessions tagged with the given label.
  • created-after=2024-01-01T00:00:00Z
  • created-before=2024-03-31T23:59:59Z
curl --request GET \  "$TRUEBAR_API_BASE_URL/api/client/sessions?name=Test&sort=createdAt,asc&slice-length=30" \  --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN"

Session details#

curl --fail --location \n  --request GET "$TRUEBAR_API_BASE_URL/api/client/sessions/$SESSION_ID" \n  --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN"

Returns the same fields as the list view, plus pipeline metadata and recording summaries.

Download audio#

curl --fail --location \n  --request GET "$TRUEBAR_API_BASE_URL/api/client/sessions/$SESSION_ID/audio.wav" \n  --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN" \n  --output session.wav

Tips:

  • Use the Range header (Range: bytes=0-1048575) to stream partial content.
  • When a client cannot set headers (e.g., a browser <audio> tag), append ?access_token=$TOKEN to the URL.

Fetch transcripts#

curl --fail --location \n  --request GET "$TRUEBAR_API_BASE_URL/api/client/sessions/$SESSION_ID/transcripts"   --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN"

Response:

[  {    "id": 7319,    "content": "{\"tokens\":[{\"text\":\"Hello\"},{\"text\":\"world\"}]}"  }]

content is a JSON string; parse it to recover the segment/token structure used across the documentation.

List recordings#

curl --fail --location \n  --request GET "$TRUEBAR_API_BASE_URL/api/client/sessions/$SESSION_ID/recordings?page=0&size=10"   --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN"

Example response (trimmed):

{  "totalPages": 1,  "totalElements": 2,  "content": [    {      "id": 10291,      "duration": 305.7,      "isDiscarded": false,      "pipeline": [        { "task": "ASR", "config": { "tag": "KALDI:sl-SI:COL:20221208-0800" } },        { "task": "NLP_pc", "config": { "tag": "NEMO_PUNCTUATOR:sl-SI:*:*" } }      ]    }  ]}

Use the pipeline snapshot to replay or diagnose historical jobs.

Session sharing#

Sessions are private by default; only the creator and group admins can view them. Use the sharing endpoints to delegate access.

Discover shareable users#

curl --fail --location \n  --request GET "$TRUEBAR_API_BASE_URL/api/client/users"   --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN"

List existing shares#

curl --fail --location \n  --request GET "$TRUEBAR_API_BASE_URL/api/client/sessions/$SESSION_ID/shares"   --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN"
[  {    "id": 912,    "createdAt": "2024-04-22T08:31:11.000Z",    "sharedWith": { "id": 37, "username": "bob@example.com" }  }]

Add a share#

curl --fail --location \n  --request POST "$TRUEBAR_API_BASE_URL/api/client/sessions/$SESSION_ID/shares"   --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN"   --header "Content-Type: application/json"   --data-raw '{ "userId": 37 }'

Remove a share#

curl --fail --location \n  --request DELETE "$TRUEBAR_API_BASE_URL/api/client/sessions/shares/$SHARE_ID"   --header "Authorization: Bearer $TRUEBAR_ACCESS_TOKEN"

Next steps#

  • Use the Offline Pipeline API to create jobs that appear in history.
  • Resume a streaming session with the sessionId returned by the WebSocket STATUS messages (see the Streaming STT guide).
  • Surface history data in your product by pairing these endpoints with custom metadata stored in your application.