> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/docs/developers/api-documentation/service-portal/open-a-document-from-the-customer-portal.md).

# Open a document from the customer portal

The url a document carries on the customer's portal page. The token in the path is the whole authorization: there is no login and no permission check. Every request is judged afresh, and the document opens only while the portal link the token was issued under still works and the document is still on the service order, still marked customer-visible, still stored privately in Flow Retail, still in the SERVICE category and on no other service order. The answer is a redirect to a short-lived address for the file itself, which the browser follows to show or download it; that address stops working within five minutes, and a document link is never a permanent link to the file. A link that no longer works is answered with a redirect to the portal's page for a link that has stopped working (`/portal/unavailable` on the portal's own address), which carries nothing about the link and chooses its language from the browser, rather than an error body: the link is opened by the browser directly, so the portal page never sees the refusal. A token that is malformed or was never issued is answered the same way, because the answer never reveals which it was. The document stays openable after the service order reaches a terminal state for as long as the portal token lives, as the page stays readable.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"ServicePortal","description":"The customer-facing service portal: the page the link in a service message opens, and the actions the customer can take from it. Authorized by the unguessable per-service-order token in the path and nothing else."}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[],"paths":{"/portal/documents/{documentToken}":{"get":{"summary":"Open a document from the customer portal","operationId":"get-portal-documents","description":"The url a document carries on the customer's portal page. The token in the path is the whole authorization: there is no login and no permission check.\nEvery request is judged afresh, and the document opens only while the portal link the token was issued under still works and the document is still on the service order, still marked customer-visible, still stored privately in Flow Retail, still in the SERVICE category and on no other service order. The answer is a redirect to a short-lived address for the file itself, which the browser follows to show or download it; that address stops working within five minutes, and a document link is never a permanent link to the file.\nA link that no longer works is answered with a redirect to the portal's page for a link that has stopped working (`/portal/unavailable` on the portal's own address), which carries nothing about the link and chooses its language from the browser, rather than an error body: the link is opened by the browser directly, so the portal page never sees the refusal. A token that is malformed or was never issued is answered the same way, because the answer never reveals which it was.\nThe document stays openable after the service order reaches a terminal state for as long as the portal token lives, as the page stays readable.","responses":{"303":{"description":"The document may be opened, or the link no longer works. The Location header is a short-lived address for the file, valid for up to five minutes, or the portal's page for a link that has stopped working.","headers":{"Location":{"description":"The short-lived address of the file itself, valid for up to five minutes, or the portal's page for a link that has stopped working.","schema":{"type":"string"}}}},"429":{"description":"Too many requests for this link. Document links are rate limited per link, whatever the address the requests come from, as every portal route is, and a request over the limit is refused rather than answered. The limit is judged before the token and counts every request whatever the token, so a 429 says nothing about whether the link works."}},"tags":["ServicePortal"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/service-portal/open-a-document-from-the-customer-portal.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
