Transcript imports

Endpoints and resources

Transcript imports

Import a labelled JSON, TXT, SRT or VTT transcript into a private session, check notes processing and retry failed notes on the same session.

POST/api/public/v2/sessions/import-transcript

Import a speaker-labelled transcript to create a private session and generate its notes automatically. Send JSON or one transcript file with multipart metadata. You need campaign:write, both read scopes and current paid editing access for an API key.

Import at least 1,500 spoken words, about 15 minutes of play; the examples on this page are shortened, so send a real session transcript. Each accepted import uses one ordinary session allowance, the same as uploading a recording. Validation failures use none. If notes generation fails after acceptance, the session and transcript remain, and the allowance stays used. Retrying failed notes on that session uses no additional session allowance.

JSON request
curl -i -X POST "https://app.saga20.com/api/public/v2/sessions/import-transcript" \
  -H "Authorization: Bearer $SAGA20_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: greywatch-transcript-20261128" \
  --data '{"title":"The Broken Gate","transcript":{"format":"json","segments":[{"speaker":"GM","text":"The gate opens.","start":1.2,"end":3.4},{"speaker":"Player A","text":"Nyra steps inside."}]},"speaker_labels":{"Player A":"Nyra"}}'

JSON body

Send Content-Type: application/json and a new Idempotency-Key. The route accepts no query parameters and does not require If-Match. Unknown fields in the body, transcript or segments are rejected.

Field Type Description
title string Required. Nonblank, at most 120 characters before trimming. Surrounding whitespace is trimmed.
recorded_at string Optional canonical UTC timestamp with milliseconds, such as 2026-11-27T19:00:00.000Z. Omit it to use acceptance time. Null is invalid. Sets the session creation and recording dates; it does not backdate allowance usage.
transcript object Required. Explicit format and either segments for json, or content for txt, srt or vtt.
speaker_labels object Optional map from exact, case-sensitive source labels in this transcript to nonblank display names of at most 500 characters. Display names are trimmed. Unknown source labels are rejected.

Speaker labels must be nonblank and at most 200 characters. Repeat the exact label for the same speaker. Different labels stay distinct even if you map them to the same display name. Labels provide attribution; they do not identify a campaign character automatically.

JSON body
{
  "title": "The Broken Gate",
  "recorded_at": "2026-11-27T19:00:00.000Z",
  "transcript": {
    "format": "json",
    "segments": [
      {"speaker": "GM", "text": "The gate opens.", "start": 1.2, "end": 3.4},
      {"speaker": "Player A", "text": "Nyra steps inside."}
    ]
  },
  "speaker_labels": {"Player A": "Nyra"}
}

JSON transcript rules

Use format: "json" and a nonempty segments array. Each segment accepts only speaker, text and optional start and end. Both speaker and spoken text must contain non-whitespace text. Surrounding spoken-text whitespace is trimmed.

Supply both timestamps as finite numbers of seconds, with start >= 0 and end >= start, or omit both. Explicit null timestamps and a single timestamp are invalid. Segments may mix timed and untimed speech. Source order and overlapping times are preserved; omitted times stay unknown.

A JSON file contains only the segments envelope below. Put its title and other metadata in the multipart metadata part.

JSON file
{
  "segments": [
    {"speaker": "GM", "text": "The gate opens.", "start": 1.2, "end": 3.4},
    {"speaker": "Nyra", "text": "I step inside."}
  ]
}

TXT transcript rules

Use format: "txt" and content containing labelled turns. Each turn starts on an unindented line as Speaker: text. The first colon separates speaker and speech. Use JSON or a VTT voice tag if a speaker name contains a colon.

Indent continuation lines with a space or tab immediately after a labelled turn or its continuation. A blank line ends that continuation. Every other nonblank line must start another labelled turn. TXT does not supply timestamps.

TXT file
GM: A lantern burns above the gate.
  Its flame gives off no heat.

Nyra: I look for the missing seal.
Inline TXT
{"title":"The Broken Gate","transcript":{"format":"txt","content":"GM: A lantern burns above the gate.\n  Its flame gives off no heat.\n\nNyra: I look for the missing seal."}}

SRT transcript rules

Use format: "srt" and content containing cues separated by blank lines. Every cue starts with a numeric identifier, then a start --> end timing line. Use HH:MM:SS,mmm: hours have at least two digits, minutes and seconds are 00 to 59, and milliseconds have exactly three digits. The end must be at or after the start. SRT timing lines do not accept cue settings.

Begin each cue's speech with Speaker: text. Wrapped lines continue that speaker. A second labelled line or a dialogue line starting with - Speaker: is rejected. Split different speakers into separate cues. SRT speech is literal text; VTT markup handling applies only to VTT.

SRT file
1
00:00:01,200 --> 00:00:03,400
GM: The gate opens.
The lantern goes dark.

2
00:00:03,000 --> 00:00:05,000
Nyra: I step inside.

VTT transcript rules

Use format: "vtt" and content beginning with WEBVTT, optionally followed by header text. Separate the header from cues with a blank line; header lines cannot contain -->. Cue identifiers are optional. Timing lines use MM:SS.mmm or HH:MM:SS.mmm, with at least two hour digits when supplied, minutes and seconds from 00 to 59, and exactly three millisecond digits. The end must be at or after the start. Cue settings after the end time are accepted.

Each cue needs one covering <v Speaker> voice tag or, without a voice tag, a Speaker: text prefix under the SRT attribution rules. A covering voice tag can have class suffixes, such as <v.party Nyra>. Its closing </v> is optional. Keep all speech inside that voice tag; nested or additional voice tags and speech outside the tag are rejected.

VTT file
WEBVTT

gate
00:01.200 --> 00:03.400
<v GM>The <b>gate</b> opens.</v>

00:03.000 --> 00:05.000 align:start
<v.party Nyra>I step inside.</v>

VTT markup and metadata

Class, bold, italic and underline tags (c, b, i, u, including class suffixes) and valid word timestamp tags are supported. Close formatting tags in nesting order. Encode literal angle brackets as entities. Other markup is rejected. NOTE, STYLE and REGION blocks are skipped.

Saga20 decodes &amp;, &lt;, &gt;, &nbsp;, &lrm;, &rlm;, &quot; and &apos; once. It does not reinterpret decoded text as markup. Other entity text remains literal. Cue order and overlapping times are preserved.

Multipart file request

Send exactly one string part named metadata containing a JSON object and one file part named file. Metadata accepts only title, format and optional recorded_at and speaker_labels. Select one explicit lowercase format: json, txt, srt or vtt. Saga20 does not infer the format or speakers from the filename or file media type.

Upload the transcript document itself. A JSON file contains {"segments":[...]}; other files contain the corresponding text format above. Files must be UTF-8. A byte-order mark and CRLF or CR line endings are accepted. NUL and binary control characters are rejected, while tabs and line breaks are allowed. Archives and PDF documents are unsupported; extract or convert them to a supported labelled transcript first.

Use a mapping only for labels that occur in your file. Omit speaker_labels if you want to retain its labels. Let your HTTP client set the multipart boundary and Content-Type.

Multipart request
curl -i -X POST "https://app.saga20.com/api/public/v2/sessions/import-transcript" \
  -H "Authorization: Bearer $SAGA20_API_KEY" \
  -H "Idempotency-Key: greywatch-vtt-import-20261128" \
  -F 'metadata={"title":"The Broken Gate","format":"vtt"}' \
  -F '[email protected]'

Size limits

These limits apply separately. Each accepted import uses its own session allowance, so import a whole session rather than splitting a short one.

Field Type Description
Complete request bytes At most 1,100,000, for JSON or the whole multipart body including boundaries.
Multipart metadata UTF-8 bytes At most 16,384.
Multipart file bytes At most 1,000,000.
Formatted transcript characters At most 500,000 by JavaScript string length, including repeated display names and separators.
Spoken words count At least 1,500, about 15 minutes of play. Saga20 counts the words in spoken text, not speaker labels. Saga20 counts words in any language, so unspaced Japanese or Chinese speech counts by its words. A shorter transcript returns 422 with transcript_too_short and uses no session allowance.

Inline text must also exclude NUL and binary control characters. Internal punctuation and line breaks are retained after surrounding speech whitespace is trimmed. Send uncompressed bodies; omit Content-Encoding or use identity. The request body must arrive within five seconds.

Accepted response

202 means Saga20 created the private session, used one session allowance and queued notes generation together. It does not mean the notes are ready. Location points to the processing URL. Idempotency-Replayed matches meta.replayed.

data.id is the session UUID, kind is session, processing_state is queued, and session_allowance_consumed is 1. Follow resource_url for session metadata, or processing_url to check progress. Imports use the stored session_type: "audio" without an attached recording. The API does not return recordings or transcript content.

Accepted response
{
  "data": {
    "id": "7b1e3f0a-52c4-4d1e-9a2b-3c8f6d1a9e41",
    "kind": "session",
    "processing_state": "queued",
    "session_allowance_consumed": 1,
    "resource_url": "/api/public/v2/sessions/7b1e3f0a-52c4-4d1e-9a2b-3c8f6d1a9e41",
    "processing_url": "/api/public/v2/sessions/7b1e3f0a-52c4-4d1e-9a2b-3c8f6d1a9e41/processing"
  },
  "meta": {"replayed": false}
}

Check processing

GET/api/public/v2/sessions/{id}/processing

Requires campaign:read and campaign:read_private. Use the imported session UUID as id. This route accepts no query parameters or body. It returns 200 with data.id, state and notes_url. State is queued, processing, completed or failed. Delay between polls and follow the request budgets.

When state is completed, read notes_url using the document formats. On failure, error contains code and message; retry_url appears only when you can retry failed notes on that session. Review notes_url after a document conflict because newer notes may have been preserved. A session without an imported transcript, or outside your campaign, returns 404 with not_found.

Processing request
curl "https://app.saga20.com/api/public/v2/sessions/7b1e3f0a-52c4-4d1e-9a2b-3c8f6d1a9e41/processing" \
  -H "Authorization: Bearer $SAGA20_API_KEY"
Failed processing response
{
  "data": {
    "id": "7b1e3f0a-52c4-4d1e-9a2b-3c8f6d1a9e41",
    "state": "failed",
    "notes_url": "/api/public/v2/sessions/7b1e3f0a-52c4-4d1e-9a2b-3c8f6d1a9e41/document",
    "error": {"code":"PROCESSING_UNAVAILABLE","message":"Processing did not finish. Retry this same session."},
    "retry_url": "/api/public/v2/sessions/7b1e3f0a-52c4-4d1e-9a2b-3c8f6d1a9e41/processing/retry"
  }
}

Retry failed notes

POST/api/public/v2/sessions/{id}/processing/retry

Requires campaign:write, both read scopes and current paid editing access for an API key. Send Content-Type: application/json, exactly {} and a new Idempotency-Key for this intentional retry. The route accepts no query parameters and does not require If-Match. The stored transcript is reused; you cannot replace it in this request.

Only failed notes on an imported session can be retried. Queued or active work returns 409 with processing_in_progress; notes that are no longer failed return 409 with processing_already_completed. Check processing before another attempt. Temporary failures may already be queued for an automatic retry.

The 202 acknowledgement has the same fields and processing Location as an import, with the existing session id and session_allowance_consumed: 0. A retry still uses your request and editing budgets.

Retry request
curl -i -X POST "https://app.saga20.com/api/public/v2/sessions/7b1e3f0a-52c4-4d1e-9a2b-3c8f6d1a9e41/processing/retry" \
  -H "Authorization: Bearer $SAGA20_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: greywatch-notes-retry-20261128" \
  --data '{}'

Idempotency and lost responses

Keep the same API key, command key, method, path and request content for transport retries within the 24-hour receipt window. Follow the Idempotency-Key rules. Multipart identity uses the parsed metadata and transcript; changing a boundary, filename or file media type does not create a new command.

An identical retry returns the original 202 acknowledgement with meta.replayed: true and Idempotency-Replayed: true. It creates no second session, uses no additional session allowance and does not restart notes generation. Changing request content under a retained command key returns 409 with idempotency_mismatch.

After the receipt window or key rotation, inspect existing sessions before sending an uncertain import again. Use a new command key for a deliberate retry of failed notes on the existing session, then keep that key for transport retries of the retry request.

Import errors

Transcript validation errors can include details.field, line, cue or segment. Line, cue and segment positions start at 1. Correct the reported location before trying again. Error responses use the error shape; authentication, scope, command-key and request-budget errors follow that reference.

Status Error When
400 invalid_multipart Send exactly one string metadata part and one file part.
400 invalid_json Fix malformed request JSON or JSON in the multipart metadata.
408 request_timeout The body did not arrive within the deadline. Retry the same command if its result is uncertain.
413 body_too_large Reduce the complete body or multipart metadata.
413 transcript_file_too_large Reduce the file to at most 1,000,000 bytes.
413 transcript_too_large Shorten the formatted transcript or repeated display names to fit 500,000 characters.
415 unsupported_media_type, unsupported_encoding Use JSON or multipart with an uncompressed body.
415 unsupported_transcript_media, invalid_transcript_encoding Supply a supported UTF-8 text file without archive, PDF or binary bytes.
422 invalid_fields Remove unsupported fields; retry bodies must be empty objects.
422 invalid_title, invalid_recorded_at, invalid_speaker_labels Correct session metadata or exact label mappings.
422 invalid_transcript, unsupported_transcript_format, invalid_transcript_json Supply the explicit format and its supported envelope.
422 invalid_segments, invalid_segment, empty_transcript Supply a nonempty JSON segment array or labelled spoken content.
422 transcript_too_short Import at least about 15 minutes of play, 1,500 spoken words, so the notes have enough to work from.
422 invalid_speaker, invalid_text, invalid_transcript_encoding Supply nonblank labels and speech without binary control characters.
422 invalid_timestamps Supply both JSON times as finite nonnegative seconds with end at or after start, or omit both.
422 invalid_txt_line Label turns and indent only immediate continuation lines.
422 invalid_cue, missing_speaker, ambiguous_speaker Correct cue timing or split speech into one labelled speaker per cue.
422 invalid_vtt_header, invalid_vtt_voice Correct the VTT header, covering voice tag or supported markup.
429 session_allowance_exhausted Check session usage or your plan. Waiting for a request-rate window does not restore session allowance.
503 processing_status_unavailable Retry the processing read after a delay.
503 commit_unavailable Retry the identical import or retry command with its original Idempotency-Key.

Processing failures

These codes appear in a successful processing read's data.error, rather than as HTTP error statuses. Follow the returned message and use retry_url only when present.

Field Type Description
DOCUMENT_CONFLICT error code Review the notes that Saga20 preserved before generating again.
SUMMARY_LIMIT_REACHED error code Check this session's notes generation allowance before retrying.
ACCESS_DENIED, PROCESSING_ACCESS_LOST error code Restore campaign access and, when requested, processing consent.
INVALID_SOURCE error code Check the imported transcript in Saga20.
SUMMARY_GENERATION_FAILED error code Review the session before retrying notes generation.
PROCESSING_UNAVAILABLE, PROCESSING_FAILED error code Retry the existing session when retry_url is present.
Other returned codes error code Follow the returned message. Retry the same session when retry_url is present.