๐Ÿ“ฅList, Fetch, and Download Documents

Once a briefing document has been generated successfully, you can manage it through the dedicated /documents endpoints.

1. List Documents

curl -X GET "https://api.autocontentapi.com/documents/get?page=1&pageSize=20" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Example response:

{
  "items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "type": "briefing_doc",
      "format": "pdf",
      "title": "Briefing Document: AI Procurement in Healthcare",
      "createdOn": "2026-03-11T19:12:00Z",
      "status": 100
    }
  ],
  "totalCount": 1,
  "page": 1,
  "pageSize": 20,
  "totalPages": 1
}

2. Fetch One Document

For format: "pdf", the response includes url. For format: "text" or format: "html", the response includes content.

3. Download the Stored Result

The download endpoint returns the stored result using the correct file extension and content type.

4. Poll with /content/Status/{id} While Waiting

/documents/{id} only returns a result after the document has been generated successfully. While the request is still running, use /content/Status/{id}:

Tips

  • Treat /content/Status/{id} as the job-status API.

  • Treat /documents/get and /documents/{id} as the document library API.

  • For pdf, you can either read document_url from the status response or url from /documents/{id}.

Try it in code

Last updated