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/delete-transcript-draft.md, and every docs URL returns Markdown when requested with Accept: text/markdown.

Delete the transcript draft

Deletes a generation's saved transcript draft and advances revision so stale saves from before the delete are rejected.

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

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

Request

Pass project_id and generation_id in the path, and optional revision in the query string.

Path parameters

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

Query parameters

FieldTypeRequiredDescription
#revisionstringRequired: NoOptional opaque revision last read; refuses the delete with 409 (revision_conflict) if a newer draft was saved since.

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)

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

Response

Returns deleted: true and the current post-delete revision.

Success: 200OK.

Response fields

FieldTypePresentDescription
#objectstringAlwaysResource type, always "transcript_draft".transcript_draft
#project_idstringAlwaysIdentifier of the parent project.
#generation_idstringAlwaysIdentifier of the generation.
#deletedbooleanAlwaysAlways true.true
#revisionstringAlwaysRevision representing the deleted state (unchanged when nothing was saved); pass to the next save.

Response 200OK.

Successful response
{
  "object": "transcript_draft",
  "project_id": "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
  "generation_id": "ce832a32-a1ce-516a-b8bd-75457bd8517f",
  "deleted": true,
  "revision": "2"
}

Return codes

  • 200OK.Draft deleted (or already absent) and the current revision is returned.
  • 400Bad request.revision query parameter is not one a draft answer gave, or Diffio-End-User exceeds 128 characters. invalid_parameterinvalid_header
  • 403Forbidden: the key lacks permission.Key is inactive or lacks generations:write. permission_denied
  • 404Not found.Project not found, or generation not found. project_not_foundgeneration_not_found
  • 409Conflict: see error.code for which one.Query revision does not match the current draft revision, reported in details.current_revision. revision_conflict
  • 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

  • Deleting when no draft is saved still succeeds with 200 (deleted: true) unless a stale revision query parameter was passed.
  • Deleting a draft records a tombstone revision so an older editor session saving with a pre-delete revision receives 409 (revision_conflict).

Report an issue with this page