{
  "openapi": "3.1.0",
  "info": {
    "title": "SpeakCoach API",
    "version": "1",
    "description": "Record or upload up to ten minutes of speech and get a transcript, pace, pauses and fillers measured in code, and feedback that cites transcript segments with three practice drills. Correct the transcript and the filler candidates, confirm a revision, then export SRT or a PDF. Pace bands are descriptive ranges: SpeakCoach describes the recording, never the speaker, and has no score, grade or ranking. Authenticate with an API key (Authorization: Bearer <key> or X-API-Key). One unit is one started minute of audio, billed after the analysis is delivered (the first three minutes are free); everything else is free. Errors are RFC 7807 problems with a stable code."
  },
  "servers": [
    {
      "url": "https://speakcoach.sensifai.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Sessions",
      "description": "Recording in, confirmed transcript and numbers out."
    },
    {
      "name": "Jobs",
      "description": "Poll or cancel an analysis."
    }
  ],
  "paths": {
    "/api/v1/sessions": {
      "post": {
        "operationId": "createSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Analyse a recording",
        "description": "Uploads one recording of at most 10 minutes (multipart field `audio`; WebM, Ogg, WAV, MP3, M4A, MP4 or FLAC, checked by content, at most 20 MB) with its context: `goal`, `language`, optional `title`, `script` and `target_seconds`, `duration_hint_ms` (the length the browser measured, used only to check your balance up front), `pause_ms` (400-2000, default 600), `keep_audio`, and `consent_all_speakers=true` to confirm that everyone who speaks in the recording agrees. Send `consent=true` the first time to agree that the recording is processed. Alternatively send the same fields as one JSON string in `meta`. Answers 202 with a session and a job to poll. Send an `Idempotency-Key` header so a retry never starts a second analysis. One unit is one started minute of the measured audio, billed once, after the analysis is delivered; no speech, a recording that is too long or unreadable, an unsupported language, a cancellation and any failure are never charged.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "A unique key per request; the same key returns the same job.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "audio",
                  "goal",
                  "language",
                  "consent_all_speakers"
                ],
                "properties": {
                  "audio": {
                    "type": "string",
                    "format": "binary"
                  },
                  "meta": {
                    "type": "string",
                    "description": "Optional: the fields below as a JSON object."
                  },
                  "goal": {
                    "type": "string",
                    "enum": [
                      "interview",
                      "pitch",
                      "presentation",
                      "speech",
                      "language",
                      "other"
                    ]
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "de",
                      "fa"
                    ]
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "script": {
                    "type": "string",
                    "maxLength": 6000
                  },
                  "target_seconds": {
                    "type": "integer",
                    "minimum": 10,
                    "maximum": 600
                  },
                  "duration_hint_ms": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "pause_ms": {
                    "type": "integer",
                    "minimum": 400,
                    "maximum": 2000
                  },
                  "keep_audio": {
                    "type": "boolean"
                  },
                  "consent_all_speakers": {
                    "type": "boolean"
                  },
                  "consent": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Accepted"
                }
              }
            }
          },
          "402": {
            "description": "PAYMENT_REQUIRED: the prepaid wallet cannot cover the recording (top_up_url).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "NEEDS_CONSENT, or no active subscription (subscribe_url).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "413": {
            "description": "INVALID_INPUT: the recording is larger than the upload limit.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_INPUT, or UNSUPPORTED: the file is not an accepted recording.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "QUOTA_EXCEEDED: an hourly limit was reached.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listSessions",
        "tags": [
          "Sessions"
        ],
        "summary": "List sessions",
        "description": "Newest first. Filter by `state`, `goal` and a title search `q`; page with `limit` (1-100, default 30) and `offset`.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "goal",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sessions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sessions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SessionSummary"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{id}": {
      "get": {
        "operationId": "getSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Get a session",
        "description": "The session with its latest analysis (or `revision=N`), the revision history, `can_confirm` with the `blockers` that must clear first, `can_export`, `regen_left` and the shares. `analysis` is null while the session is analysing or when it ended without one.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no such session (or it belongs to someone else).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Delete a session",
        "description": "Removes the session, its revisions, recording, shares and history row. A running analysis is cancelled and not billed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "NOT_FOUND: no such session (or it belongs to someone else).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{id}/transcript": {
      "patch": {
        "operationId": "editTranscript",
        "tags": [
          "Sessions"
        ],
        "summary": "Correct the transcript",
        "description": "Replaces the text of up to 200 segments (at most 600 characters each; an empty text removes the segment's words). Words are placed again inside the segment's span, fillers are detected again and every number is recomputed in code. Optionally changes the pause threshold (`pause_ms`, 400-2000). Creates a new draft revision. Free.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "segments": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/SegmentEdit"
                    }
                  },
                  "pause_ms": {
                    "type": "integer",
                    "minimum": 400,
                    "maximum": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The session with the new draft revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no such session (or it belongs to someone else).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT or NOT_CONFIRMED.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_INPUT.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{id}/recompute": {
      "post": {
        "operationId": "recomputeSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Recompute the numbers",
        "description": "Recomputes every measured number, optionally at a new pause threshold (`pause_ms`, 400-2000), keeping your filler decisions. Creates a new draft revision. Free.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pause_ms": {
                    "type": "integer",
                    "minimum": 400,
                    "maximum": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The session with the new draft revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no such session (or it belongs to someone else).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT or NOT_CONFIRMED.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_INPUT.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{id}/metrics": {
      "get": {
        "operationId": "getMetrics",
        "tags": [
          "Sessions"
        ],
        "summary": "Get the measured numbers",
        "description": "Pace, pauses, fillers and sentence statistics of the latest revision, with the pause and filler lists. Counts are lower bounds.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metrics, pauses and fillers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "metrics": {
                      "$ref": "#/components/schemas/Metrics"
                    },
                    "pauses": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "fillers": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no such session (or it belongs to someone else).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT or NOT_CONFIRMED.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{id}/confirm": {
      "post": {
        "operationId": "confirmSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Confirm the latest revision",
        "description": "Confirms the latest draft revision. Every revision carries independent checks (`checks_passed` of `checks_total`); a failing hard check blocks confirmation and is listed in `blockers` of the 409 problem. Idempotent when the latest revision is already confirmed. Exports and share links use a confirmed revision only. Free.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The session with a confirmed revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no such session (or it belongs to someone else).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT or NOT_CONFIRMED.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{id}/exports": {
      "post": {
        "operationId": "exportSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Export a confirmed revision",
        "description": "Returns the latest confirmed revision (or `revision`) as an attachment: `srt` subtitles or a printable `pdf`. 409 NOT_CONFIRMED until a revision is confirmed. Free.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "srt",
                      "pdf"
                    ]
                  },
                  "revision": {
                    "type": "integer"
                  }
                },
                "required": [
                  "format"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The file.",
            "content": {
              "application/x-subrip": {
                "schema": {
                  "type": "string"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no such session (or it belongs to someone else).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT or NOT_CONFIRMED.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_INPUT.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}": {
      "get": {
        "operationId": "getJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Get a job",
        "description": "Polls an analysis. States: queued, running, needs_input (no speech or an unsupported language: record again, free), completed, failed, cancelled. `units` is what was billed (the started minutes), 0 for anything that was not delivered.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "QUOTA_EXCEEDED: an hourly limit was reached.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}/cancel": {
      "post": {
        "operationId": "cancelJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Cancel a job",
        "description": "Stops a queued or running analysis; nothing is billed. A finished job answers 409.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The job, cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "409": {
            "description": "CONFLICT or NOT_CONFIRMED.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "required": [
          "code",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "enum": [
              "INVALID_INPUT",
              "NEEDS_CONSENT",
              "UNSUPPORTED",
              "QUOTA_EXCEEDED",
              "PROVIDER_UNAVAILABLE",
              "NOT_FOUND",
              "NOT_CONFIRMED",
              "CONFLICT",
              "GONE",
              "UNAUTHORIZED",
              "FORBIDDEN",
              "PAYMENT_REQUIRED"
            ]
          },
          "detail": {
            "type": "string"
          },
          "blockers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Present on a refused confirmation: the checks that must pass."
          },
          "subscribe_url": {
            "type": "string"
          },
          "top_up_url": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "timestamp": {
            "type": "integer"
          }
        }
      },
      "Accepted": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string"
          },
          "job_id": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "poll": {
            "type": "string"
          }
        }
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "analyze",
              "coach"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "needs_input",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "needs_input",
              "completed",
              "failed",
              "cancelled"
            ],
            "description": "The same value as status."
          },
          "message": {
            "type": "string"
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "charged": {
            "type": "boolean"
          },
          "units": {
            "type": "integer"
          }
        }
      },
      "SessionSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "goal": {
            "type": "string",
            "enum": [
              "interview",
              "pitch",
              "presentation",
              "speech",
              "language",
              "other"
            ]
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "de",
              "fa"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "analyzing",
              "draft",
              "confirmed",
              "failed",
              "needs_input"
            ]
          },
          "duration_ms": {
            "type": "integer"
          },
          "target_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "words": {
            "type": "integer"
          },
          "wpm_speaking": {
            "type": [
              "number",
              "null"
            ]
          },
          "wpm_elapsed": {
            "type": [
              "number",
              "null"
            ]
          },
          "pauses": {
            "type": "integer"
          },
          "fillers": {
            "type": "integer"
          },
          "longest_pause_ms": {
            "type": "integer"
          },
          "pauses_per_min": {
            "type": [
              "number",
              "null"
            ]
          },
          "fillers_per_min": {
            "type": [
              "number",
              "null"
            ]
          },
          "pause_ms": {
            "type": "integer"
          },
          "revision_no": {
            "type": "integer"
          },
          "confirmed_revision_no": {
            "type": [
              "integer",
              "null"
            ]
          },
          "has_audio": {
            "type": "boolean"
          },
          "audio_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "kept_audio": {
            "type": "boolean"
          },
          "job_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Metrics": {
        "type": "object",
        "properties": {
          "elapsed_ms": {
            "type": "integer"
          },
          "speaking_ms": {
            "type": "integer"
          },
          "words": {
            "type": "integer"
          },
          "wpm_elapsed": {
            "type": [
              "number",
              "null"
            ]
          },
          "wpm_speaking": {
            "type": [
              "number",
              "null"
            ]
          },
          "pace_band": {
            "type": "string",
            "enum": [
              "slow",
              "comfortable",
              "brisk",
              "fast"
            ]
          },
          "pace_range": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "pause_threshold_ms": {
            "type": "integer"
          },
          "pause_count": {
            "type": "integer"
          },
          "long_pause_count": {
            "type": "integer"
          },
          "longest_pause_ms": {
            "type": "integer"
          },
          "pauses_per_min": {
            "type": [
              "number",
              "null"
            ]
          },
          "pause_total_ms": {
            "type": "integer"
          },
          "filler_count": {
            "type": "integer"
          },
          "fillers_per_min": {
            "type": [
              "number",
              "null"
            ]
          },
          "sentence_count": {
            "type": "integer"
          },
          "avg_sentence_words": {
            "type": [
              "number",
              "null"
            ]
          },
          "max_sentence_words": {
            "type": "integer"
          },
          "lead_in_ms": {
            "type": "integer"
          },
          "target_delta_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "script_match_percent": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "description": "Every number is measured in code. wpm and rates are null when undefined. Counts are lower bounds: a transcript engine drops hesitations."
      },
      "Analysis": {
        "type": "object",
        "description": "One immutable revision. Word times are estimated from the audio (timing: estimated); pauses, speaking time and lead-in are measured from the voiced spans.",
        "properties": {
          "version": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "confirmed"
            ]
          },
          "language": {
            "type": "string"
          },
          "rtl": {
            "type": "boolean"
          },
          "goal": {
            "type": "string",
            "enum": [
              "interview",
              "pitch",
              "presentation",
              "speech",
              "language",
              "other"
            ]
          },
          "duration_ms": {
            "type": "integer"
          },
          "target_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "pauses": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "fillers": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "metrics": {
            "$ref": "#/components/schemas/Metrics"
          },
          "script": {
            "type": [
              "object",
              "null"
            ]
          },
          "voice": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "s": {
                  "type": "integer"
                },
                "e": {
                  "type": "integer"
                }
              }
            }
          },
          "timing": {
            "type": "string",
            "enum": [
              "estimated"
            ]
          },
          "coaching": {
            "type": "object",
            "properties": {
              "feedback": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "structure": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "unknowns": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "drills": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "ok": {
                  "type": "boolean"
                },
                "hard": {
                  "type": "boolean"
                },
                "detail": {
                  "type": "string"
                }
              }
            }
          },
          "checks_passed": {
            "type": "integer"
          },
          "checks_total": {
            "type": "integer"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "provenance": {
            "type": "object"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "script_text": {
            "type": "string",
            "description": "The script you supplied, returned only to you."
          }
        }
      },
      "Revision": {
        "type": "object",
        "properties": {
          "no": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "confirmed"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Share": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "revision_no": {
            "type": "integer"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "include_transcript": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "views": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          }
        }
      },
      "Session": {
        "type": "object",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/SessionSummary"
          },
          "analysis": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Analysis"
              },
              {
                "type": "null"
              }
            ]
          },
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Revision"
            }
          },
          "can_confirm": {
            "type": "boolean"
          },
          "blockers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "can_export": {
            "type": "boolean"
          },
          "can_share": {
            "type": "boolean"
          },
          "regen_left": {
            "type": "integer"
          },
          "audio": {
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "url": {
                "type": "string"
              }
            }
          },
          "shares": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Share"
            }
          },
          "model": {
            "type": "object"
          }
        }
      },
      "SegmentEdit": {
        "type": "object",
        "required": [
          "id",
          "text"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "maxLength": 600
          }
        }
      }
    }
  }
}
