Ask a person for a file or a secret
POST /Platform/uploads/links
Ask a person for a file or a secret.
Returns a page url to give the person. They open it, sign in as
the account you are acting for, and pick the file from their own
device; nothing passes through you. Hosts that render apps show a
file picker for the same link right in the conversation. Use it when the person has the
file (an attachment in this chat, a document on their computer) and
you cannot send its bytes yourself. Then ask them to say when they are
done and call get_upload_link, which lists the files with their
handles.
For a credential the person has not told you (a password, an API key,
a token), use kind="secret": the page takes it in a hidden input
and stores it in the organization's secret store, and you only ever
get its handle. For the password of a website login, also pass the
login's sites: the page shows them, and a browser types the
password only on them. Some MCP clients open the secret page for the
person themselves and return only afterwards: a result whose
status is already done carries the handle in files, so do
not ask again, and a person who declines is reported as an error.
Body parameters
purpose: optional str. What the files are for, shown on the page (for example "the signed intake form").max_files: optional int. How many files the link accepts.kind: optional "file" or "secret". file: the person picks files. secret: the person types one credential, such as a password or an API key; you get its handle, never the value, and max_files is 1.sites: optional List[Any]. Only withkind="secret", for a website login's password: the login'sorigins, each an exactscheme://host[:port]. The handle is bound to them.
Returns
UploadLink
link_id: str. Upload link identifier.url: str. Page to give the person; it requires signing in as the account that created it.kind: optional "file" or "secret". file: the person picks files. secret: the person types one credential, and files[0].hash is its handle.purpose: optional str. What the files are for, shown on the page.sites: optional List[str]. For a website login's password: the sites a browser may type it on, shown on the page. The handle is bound to them.max_files: int. How many files the link accepts.status: "pending" or "done" or "expired". pending: nothing uploaded yet; done: at least one file arrived; expired: closed with none.expires_at: float. When the link stops accepting files (Unix seconds).files: optional List[UploadFile]. Files uploaded through the link so far.
Example request
curl -X POST "https://api.hilus.ai/Platform/uploads/links" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'