# files.getUploadURL

> Where to send a file’s bytes: POST them (raw body) to `uploadUrl` within a few minutes, then call files.completeUpload.

Source: https://slaiky.xyz/docs/reference/methods/files.getUploadURL

`POST https://app.slaiky.xyz/api/methods/files.getUploadURL` · needs `files:write`

## Arguments

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `filename` | string | yes | 1–255 characters. |
| `length` | integer | yes | Size in bytes. 1–5,368,709,120. |
| `mime` | string | no | Up to 120 characters. |

## Answer

`{ "ok": true, … }` with: uploadUrl: string, fileId: string. A refusal is `{ "ok": false, "error": { "code", "message" } }` ([errors](/docs/errors)).

## Example

The required arguments, with placeholders in angle brackets.

*you run*

```sh

curl -s https://app.slaiky.xyz/api/methods/files.getUploadURL \
  -H "authorization: Bearer $SLAIKY_BOT_TOKEN" \
  -H 'content-type: application/json' \
  -d '{"filename":"<filename>","length":"<length>"}'

```
