Skip to content

For AI agents: every API docs page in one plain-text file is at /docs/llms-full.txt, and the documentation index is at /llms.txt. This page is available as Markdown at https://diffio.ai/docs/api-reference/get-transcript-draft.md, and every docs URL returns Markdown when requested with Accept: text/markdown.

Get the transcript draft

Reads the saved transcript editor draft (data) and its opaque revision string for a generation.

GET https://api.diffio.ai/v2/projects/{project_id}/generations/{generation_id}/transcript/draft

  • Key scope: generations:read
  • Auth header:Authorization: Bearer <apiKey>
  • Body: None

Request

Pass project_id and generation_id in the path; takes no request body.

Path parameters

FieldTypeRequiredDescription
#project_idstringRequired: YesUnique identifier of the project.
#generation_idstringRequired: YesUnique identifier of the generation within the project.

Headers

FieldTypeRequiredDescription
#Diffio-End-UserstringRequired: NoOptional end-user identifier (up to 128 characters). Scopes the request to that end user's projects; omit to act across the whole account.

Request

import os
from diffio import DiffioClient

key = os.environ["DIFFIO_API_KEY"]
client = DiffioClient(api_key=key)

draft = client.transcripts.get_draft(
    "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
    "ce832a32-a1ce-516a-b8bd-75457bd8517f",
)

Response

Returns the transcript_draft (data: null with a valid revision when nothing is saved).

Success: 200OK.

Response fields

FieldTypePresentDescription
#objectstringAlwaysResource type, always "transcript_draft".transcript_draft
#project_idstringAlwaysIdentifier of the parent project.
#generation_idstringAlwaysIdentifier of the generation.
#revisionstringAlwaysOpaque revision string ("0" before the first save); send back when saving or deleting to detect concurrent edits.
#dataobject | nullAlwaysSaved JSON object exactly as sent to PUT .../transcript/draft, or null when no draft is saved.
#created_atstring | nullAlwaysISO 8601 UTC timestamp when the current draft was first created, or null when empty.
#updated_atstring | nullAlwaysISO 8601 UTC timestamp when the draft was last saved, or null when empty.

Response 200OK.

Successful response
{
  "object": "transcript_draft",
  "project_id": "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
  "generation_id": "ce832a32-a1ce-516a-b8bd-75457bd8517f",
  "revision": "0",
  "data": null,
  "created_at": null,
  "updated_at": null
}

Return codes

  • 200OK.Returns the current draft data (or null) and revision.
  • 400Bad request.Diffio-End-User exceeds 128 characters. invalid_header
  • 403Forbidden: the key lacks permission.Key is inactive or lacks generations:read. permission_denied
  • 404Not found.Project not found, or generation not found. project_not_foundgeneration_not_found
  • 401Unauthorized: the API key is missing or invalid.405Client error.Same on every endpoint
    • 401Unauthorized: the API key is missing or invalid. Missing API key (code missing_api_key), or invalid API key (code invalid_api_key).
    • 405Client error. HTTP method not supported on this path; check the Allow header (code method_not_allowed).

Example error response

Errors are JSON: an error object with code, message and request_id. An unrecognized key returns 401Unauthorized: the API key is missing or invalid.:

Error response
{
  "error": {
    "code": "invalid_api_key",
    "message": "Invalid API key.",
    "request_id": "dead773b60e148fd9e22d680a22fa701"
  }
}

Notes

  • Each generation has one draft shared across callers with access to the project, and draft reads/writes are free.
  • Even when no draft has been saved yet (or after a delete), GET returns 200 with data: null and the current revision so the first save can still use compare-and-swap.

Report an issue with this page