Skip to content
LydieDevelopers
Menu

Get an upload URL for a file

View as Markdown
POST/v1/attachments/uploads

Checks access and limits and returns a signed URL (15 minutes) to PUT the file's bytes to. upload is null when the same bytes are already stored. Then record the file with attachment.create. Needs edit access to the document (or membership for workspace files).

Request
curl -X POST "https://api.lydie.co/v1/attachments/uploads" \
  -H "Authorization: Bearer $LYDIE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "01JCQ3TZ0WJ8K4M2X7T9R6N1PA",
    "contentType": "string",
    "size": 0,
    "sha256": "string"
  }'

Body

Response

200
{
  "upload": null,
  "maxBytes": -9007199254740991
}

Errors use one envelope for every endpoint. See Errors and versions.