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

List a project's generations

Lists a project's generations (both full restores and transcript edits) newest first, one page at a time.

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

  • Key scope: generations:read
  • Auth header:Authorization: Bearer <apiKey>
  • Body: None
  1. GET/projects/{project_id}/generationsdata[] newest first, next_cursor
  2. Pickstatus: completeits id
  3. GET/projects/{project_id}/generations/{generation_id}/mediafiles URLs

Request

Pass project_id in the path and optional limit and cursor query parameters.

Path parameters

FieldTypeRequiredDescription
#project_idstringRequired: YesUnique identifier of the project.

Query parameters

FieldTypeRequiredDescription
#limitintegerRequired: NoMaximum number of items to return per page, from 1 to 100 (default 20).
#cursorstringRequired: NoOpaque pagination token from the previous page's next_cursor.

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)

page = client.generations.list(
    "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
)

Response

Returns a list page of Generation objects ordered newest first, with next_cursor.

Success: 200OK.

Response fields

FieldTypePresentDescription
#objectstringAlwaysResource type, always "list".list
#dataarrayAlwaysPage of Generation objects (same fields as Get a generation), newest first.
#next_cursorstring | nullAlwaysOpaque cursor to pass as cursor for the next page, or null on the final page.

Response 200OK.

Response: key fields
{
  "object": "list",
  "data": [
    {
      "id": "ce832a32-a1ce-516a-b8bd-75457bd8517f",
      "status": "complete",
      "model": "diffio-4.7-flash"
    }
  ],
  "next_cursor": null
}

Return codes

  • 200OK.Returns a page of generations for the project.
  • 400Bad request.Invalid limit or cursor query value, or Diffio-End-User exceeds 128 characters. invalid_parameterinvalid_header
  • 403Forbidden: the key lacks permission.Key is inactive or lacks generations:read. permission_denied
  • 404Not found.No project with that project_id exists for this account and end user. project_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

  • Includes both kind: "restore" generations and kind: "edit" generations created by Edit a generation's transcript.
  • Use client.generations.iter(project_id) in Python or for await (const gen of client.generations.list(projectId)) in Node.js to iterate through every page.

Report an issue with this page