API Reference

Generated documents

Generated documents are files that agents create for you with the deployment's generation tools: text, Markdown, HTML, Word and PowerPoint documents, PDFs, spreadsheets, charts and images. Each document belongs to the user it was generated for, and you can only list, download and delete your own. They are separate from the files people upload to chats.

A document's id is an opaque string. The download links that agents include in their answers use the same id.

The generated document object

One file an agent generated for the caller.

Attributes

  • id string

    Opaque identifier of the document. Use it to download or delete the document.

  • created_at string

    When the document was generated (UTC, ISO 8601).

  • user_id string

    Id of the user the document belongs to, as a string. Always the caller.

  • session_id nullable string

    Id of the session the document was generated in, when known.

  • category string

    Record category. Generated documents are recorded as generated.

  • filename string

    File name used for downloads. Generation tools prefix it with the generation time.

  • mime_type string

    Media type of the file.

The generated document object
{
  "id": "NDIvZ2VuZXJhdGVkLzIwMjYwOTAxXzA5MzAwMF9yZWxlYXNlLW5vdGVzLTQtMi5kb2N4",
  "created_at": "2026-09-01T09:30:00.412816",
  "user_id": "42",
  "session_id": "5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
  "category": "generated",
  "filename": "release-notes-4-2.docx",
  "mime_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}

List generated documents

GET /agent-hub-api/api/documents

Returns the documents generated for the caller, newest first.

Authentication
Bearer token How it works

Query parameters

  • session_id string

    Only documents generated in this session.

  • category string

    Only documents recorded under this category.

    Defaults to generated.

  • limit integer

    Maximum number of documents to return, from 1 to 1,000. Values outside that range are clamped.

    Defaults to 200.

  • offset integer

    Number of documents to skip.

    Defaults to 0.

Returns

Returns documents, a page of generated document objects, with total (the number of matching documents), offset, limit and the caller's user_id.

Request
curl "$VDF_BASE_URL/agent-hub-api/api/documents?session_id=5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58&limit=20" \
  -H "Authorization: Bearer $VDF_ACCESS_TOKEN"
Response 200
{
  "success": true,
  "user_id": "42",
  "total": 2,
  "offset": 0,
  "limit": 20,
  "documents": [
    {
      "id": "NDIvZ2VuZXJhdGVkLzIwMjYwOTAxXzEwMTUxMl9xMy1yZXZlbnVlLWNoYXJ0LnBuZw",
      "created_at": "2026-09-01T10:15:12.084511",
      "user_id": "42",
      "session_id": "5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
      "category": "generated",
      "filename": "q3-revenue-chart.png",
      "mime_type": "image/png"
    },
    {
      "id": "NDIvZ2VuZXJhdGVkLzIwMjYwOTAxXzA5MzAwMF9yZWxlYXNlLW5vdGVzLTQtMi5kb2N4",
      "created_at": "2026-09-01T09:30:00.412816",
      "user_id": "42",
      "session_id": "5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
      "category": "generated",
      "filename": "release-notes-4-2.docx",
      "mime_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
    }
  ]
}

Download a generated document

GET /agent-hub-api/api/documents/{doc_id}

Downloads one of the caller's generated documents.

The file is sent as an attachment named after the document's filename, with the document's mime_type. Responses carry an ETag, so clients can revalidate with If-None-Match.

Authentication
Bearer token How it works

Path parameters

  • doc_id string Required

    The document's id.

Returns

Returns the document's contents as a file download.

Errors

  • 400 doc_id is not a valid document id.
  • 404 You have no document with this id, or its file no longer exists.
Request
curl "$VDF_BASE_URL/agent-hub-api/api/documents/NDIvZ2VuZXJhdGVkLzIwMjYwOTAxXzA5MzAwMF9yZWxlYXNlLW5vdGVzLTQtMi5kb2N4" \
  -H "Authorization: Bearer $VDF_ACCESS_TOKEN" \
  -o documents.bin

Delete a generated document

DEL /agent-hub-api/api/documents/{doc_id}

Permanently deletes one of the caller's generated documents.

Deletes the file and its record. Download links to the document stop working.

Authentication
Bearer token How it works

Path parameters

  • doc_id string Required

    The document's id.

Returns

Returns the deleted document's id, deleted_file (whether a file was removed from storage), and removed_registry_entries (the number of document records removed).

Errors

  • 400 doc_id is not a valid document id.
  • 404 You have no document with this id.
  • 500 The file could not be removed; the document is left unchanged.
Request
curl -X DELETE "$VDF_BASE_URL/agent-hub-api/api/documents/NDIvZ2VuZXJhdGVkLzIwMjYwOTAxXzA5MzAwMF9yZWxlYXNlLW5vdGVzLTQtMi5kb2N4" \
  -H "Authorization: Bearer $VDF_ACCESS_TOKEN"
Response 200
{
  "success": true,
  "user_id": "42",
  "id": "NDIvZ2VuZXJhdGVkLzIwMjYwOTAxXzA5MzAwMF9yZWxlYXNlLW5vdGVzLTQtMi5kb2N4",
  "deleted_file": true,
  "removed_registry_entries": 1
}