Skip to Content
Docs
ReferenceRead

Read a file's lineage

POST
/get_lineage

Reads how a file was made, whatever its kind (image, video, 3D model, canvas, whiteboard or document), as awen's Lineage panel shows it: the files it came from, the step that used each one, each file's "Authorized for usage" declaration and audit severity, and the latest lineage audit. The declaration is false until a member confirms a file's rights in awen, which does not mean it is forbidden. unaudited counts the earlier files no audit has read, not this file, and the audit is null until one runs. Pass a file:… id or a media_id. Files come nearest first, up to 50 a page, with the edges from each file to the files made from it; pass next_cursor back as cursor to continue. fetch opens a file whose id is not null and gives its prompt and model. complete is false when the history is too long to read here: audit counts are then left out, and awen shows it whole.

Needs a key with awen:read. Costs 4 units of the key's rate limit.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key from Settings → Connected apps → API keys, sent as Authorization: Bearer awen_sk_…. Keep it on a server: a request from a web page is refused.

Request Body

application/json
  1. body
id*string

A file:… id or a media_id.

Length1 <= length <= 144
cursor?string
Length1 <= length <= 512

Response Body

The operation's answer.

application/json
  1. response
id*string
media_id*string
complete*boolean
nodes*array<>
edges*array<>
audit_summary*|null
next_cursor*string|null
Example Request
curl -X POST 'https://app.awen.ai/api/v1/get_lineage' \  -H 'Content-Type: application/json' \  -d '{  "id": "string"}'
Example Response
{  "id": "string",  "media_id": "string",  "complete": true,  "nodes": [    {      "id": "string",      "media_id": "string",      "revision_id": "string",      "kind": "image",      "name": "string",      "created_at": "string",      "distance": -9007199254740991,      "readable": true,      "authorized_for_usage": true,      "audit_severity": "LOW",      "inherited_audit_severity": "LOW"    }  ],  "edges": [    {      "parent_media_id": "string",      "child_media_id": "string",      "role": "SOURCE",      "position": -9007199254740991,      "operation": "GENERATE",      "step": "string"    }  ],  "audit_summary": {    "upstream_audits": {      "CRITICAL": -9007199254740991,      "HIGH": -9007199254740991,      "MODERATE": -9007199254740991,      "LOW": -9007199254740991,      "unaudited": -9007199254740991    },    "latest_audit": {      "status": "PENDING",      "summary": "string",      "created_at": "string",      "completed_at": "string"    }  },  "next_cursor": "string"}

Read an awen item POST

Reads one item by the id that search or a list returned (project:…, folder:…, file:… or conversation:…). A file gives its description, tags, prompt, model and a download link valid 5 minutes; authorized_for_usage false means no member has confirmed its rights in awen yet, not that it is forbidden. With include_preview, an image, video or 3D model also comes as a small picture you can see, when you can't open the link or the user asks what it looks like: metadata.preview says included, pending when a new file's picture is not drawn yet, so ask again in a moment, not_applicable for a text file, whose text is in the answer, or unavailable; a text file (Markdown, text, CSV, HTML) gives its content, 32 KiB at a time. A folder or project gives its listing, a memory its instructions, a conversation its messages, 20 at a time, each answer with the turn_id get_turn reads. Pass metadata.next_offset back as offset to continue a file or a conversation. Needs a key with awen:read. Costs 2 units of the key's rate limit.

Follow a turn POST

Reads a turn create_with_awen started: its status, its reply's text, its tasks and the files it saved. status is working, completed, failed or stopped. The reply ends when generations start, and the turn stays working until their tasks end. completed means every file it will make is saved; a task that failed says why in failure, so tell the user and never retry on your own. text is written as generations start and never changes: it can still say an image is generating, and it is null when the reply has no words, so read status and files to know what is ready, and fetch a file for the prompt awen used. tasks and files list at most 50 tasks: more_tasks is true when the turn made more, and list_files shows them all. The call waits up to wait_seconds (0 to 30, default 15) and answers as soon as something changes, so call it again at once while status is working, with no other pause. A turn can end with a question, with or without files: show it to the user and wait, and never answer it yourself. cost_usd is what the turn's model calls and generations were charged. It is null until nothing of the turn still runs, and where usage is hidden from members; titles, summaries and file descriptions are charged apart. Pass the last cursor back, so a change between two calls is not missed. files name each file by id with its mime_type, size_bytes, width, height and duration_seconds, each null when unknown. With include_downloads, each file also has a download_url valid 5 minutes, or null when it cannot be downloaded; without it, pass an id to fetch for one. To follow several turns at once, call get_turns. Needs a key with awen:read. Costs 1 to 4 units of the key's rate limit, by its arguments.