# Documents

Briefing document assets generated per token

## Get documents

> Returns paginated briefing documents created by the authenticated token, including in-progress requests.

```json
{"openapi":"3.0.0","info":{"title":"Content API","version":"1.0.0"},"tags":[{"name":"Documents","description":"Briefing document assets generated per token"}],"servers":[{"url":"https://api.autocontentapi.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Document":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document (matches request id)"},"type":{"type":"string","description":"Document type"},"format":{"type":"string","enum":["text","html","pdf"],"description":"Stored result format"},"title":{"type":"string","nullable":true,"description":"Optional document title"},"status":{"type":"integer","description":"Current progress percentage (100 when completed)"},"createdOn":{"type":"string","format":"date-time","description":"UTC timestamp when the document row was created"},"content":{"type":"string","nullable":true,"description":"Text or HTML content when format is `text` or `html`"},"url":{"type":"string","nullable":true,"description":"Direct PDF URL when format is `pdf`"}}}}},"paths":{"/documents/get":{"get":{"summary":"Get documents","description":"Returns paginated briefing documents created by the authenticated token, including in-progress requests.","tags":["Documents"],"parameters":[{"in":"query","name":"page","schema":{"type":"integer","minimum":1},"description":"Page number (default 1)"},{"in":"query","name":"pageSize","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Items per page (default 20, max 100)"}],"responses":{"200":{"description":"Paginated list of documents","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"totalCount":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"totalPages":{"type":"integer"}}}}}},"401":{"description":"Unauthorized"}}}}}}
```

## Get document

> Returns the stored briefing document payload for the authenticated token.

```json
{"openapi":"3.0.0","info":{"title":"Content API","version":"1.0.0"},"tags":[{"name":"Documents","description":"Briefing document assets generated per token"}],"servers":[{"url":"https://api.autocontentapi.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Document":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the document (matches request id)"},"type":{"type":"string","description":"Document type"},"format":{"type":"string","enum":["text","html","pdf"],"description":"Stored result format"},"title":{"type":"string","nullable":true,"description":"Optional document title"},"status":{"type":"integer","description":"Current progress percentage (100 when completed)"},"createdOn":{"type":"string","format":"date-time","description":"UTC timestamp when the document row was created"},"content":{"type":"string","nullable":true,"description":"Text or HTML content when format is `text` or `html`"},"url":{"type":"string","nullable":true,"description":"Direct PDF URL when format is `pdf`"}}}}},"paths":{"/documents/{documentId}":{"get":{"summary":"Get document","description":"Returns the stored briefing document payload for the authenticated token.","tags":["Documents"],"parameters":[{"in":"path","name":"documentId","required":true,"schema":{"type":"string"},"description":"Document request identifier"}],"responses":{"200":{"description":"Document payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Document not found"}}}}}}
```

## Download document

> Downloads the stored briefing document as PDF, HTML, or text for the authenticated token.

```json
{"openapi":"3.0.0","info":{"title":"Content API","version":"1.0.0"},"tags":[{"name":"Documents","description":"Briefing document assets generated per token"}],"servers":[{"url":"https://api.autocontentapi.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/documents/{documentId}/download":{"get":{"summary":"Download document","description":"Downloads the stored briefing document as PDF, HTML, or text for the authenticated token.","tags":["Documents"],"parameters":[{"in":"path","name":"documentId","required":true,"schema":{"type":"string"},"description":"Document request identifier"}],"responses":{"200":{"description":"Document download","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Document not found or not ready"},"502":{"description":"Upstream asset unavailable"}}}}}}
```

## Preview document

> Streams the stored briefing document inline using its native format. Supports PDF, HTML, and plain text documents for the authenticated token.

```json
{"openapi":"3.0.0","info":{"title":"Content API","version":"1.0.0"},"tags":[{"name":"Documents","description":"Briefing document assets generated per token"}],"servers":[{"url":"https://api.autocontentapi.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/documents/{documentId}/preview":{"get":{"summary":"Preview document","description":"Streams the stored briefing document inline using its native format. Supports PDF, HTML, and plain text documents for the authenticated token.","tags":["Documents"],"parameters":[{"in":"path","name":"documentId","required":true,"schema":{"type":"string"},"description":"Document request identifier"}],"responses":{"200":{"description":"Document preview","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"text/html":{"schema":{"type":"string"}},"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Document not found or not ready"},"502":{"description":"Upstream asset unavailable"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.autocontentapi.com/readme/documents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
