Uploads
Signature, parameters, an example call and the sample response for every method in this group, generated from the contract.
lid.uploads.create
Host a file on Lid from a public URL. gated:true = the content the buyer pays for (returns a key for extraFiles); gated:false = cover or gallery (returns a stable URL). 25 MB cap.
Key permission: catalogo (catalog)
lid.uploads.create(input, options?)
| Name | Type | Required | Source |
|---|---|---|---|
file | Blob | Uint8Array | Optional | body |
url | string | Optional | body |
filename | string | Optional | body |
gated | boolean | Optional | body |
const result = await lid.uploads.create({
file, // a Blob or Uint8Array; or pass { url } instead
filename: '…',
gated: false,
});{
"ok": true,
"key": "public/files/bd0b5363-696d-4ac3-9b29-d81e1cf94974-docs-capture.txt",
"url": "https://lidpro-q2r8s1hvcfekebiwyu.t3.storageapi.dev/public/files/bd0b5363-696d-4ac3-9b29-d81e1cf94974-docs-capture.txt",
"gated": false,
"name": "docs-capture.txt",
"type": "text/plain",
"size": 31
}