Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Files API

Upload A File

curl -F file=@example.txt \
  -F expires=7d \
  -F visibility=unlisted \
  http://127.0.0.1:8080/api/v1/files

Authenticated upload:

curl -H 'authorization: Bearer mdd_TOKEN' \
  -F file=@example.txt \
  http://127.0.0.1:8080/api/v1/files

Required scope for authenticated callers:

files:write

Response:

{
  "id": "abc123",
  "url": "http://127.0.0.1:8080/abc123.txt",
  "raw_url": "http://127.0.0.1:8080/files/abc123/raw",
  "internal_url": null,
  "delete_token": "token"
}

List My Files

curl -H 'authorization: Bearer mdd_TOKEN' \
  'http://127.0.0.1:8080/api/v1/me/files?q=example'

Required scope:

files:read

Response:

{
  "items": []
}

Delete A File

curl -X DELETE \
  -H 'authorization: Bearer mdd_TOKEN' \
  http://127.0.0.1:8080/api/v1/files/abc123

Required scope:

files:delete

Anonymous delete token:

curl -X DELETE \
  -H 'x-delete-token: DELETE_TOKEN' \
  http://127.0.0.1:8080/api/v1/files/abc123

Response:

{
  "deleted": true
}

Claim A File

curl -H 'authorization: Bearer mdd_TOKEN' \
  -H 'content-type: application/json' \
  -d '{"delete_token":"DELETE_TOKEN"}' \
  http://127.0.0.1:8080/api/v1/claim/file/abc123

Required scope:

items:claim