Change file path

PATCH /{client}/{file}

Body

  • slug string Required

    New file name

Responses

  • 200

    Info about file

    Hide response attributes Show response attributes object
    • name string
    • owner string
    • visibility string

      Values are public or private.

    • path string

      file path without domain

    • mime string
    • size number

      size of a file in bytes

    • lastModified number

      UNIX timestamp of the last time the file was modified

  • 500

    unexpected error

    Hide response attributes Show response attributes object
    • message string
    • code number
PATCH /{client}/{file}
curl \
 -X PATCH http://api.example.com/{client}/{file} \
 -H "x-api-key: $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"slug":"new-file-name"}'
Request example
{
  "slug": "new-file-name"
}
Request examples
{
  "slug": "new-file-name"
}
Response examples (200)
{
  "name": "8BgXSCaMZae9auk1kVA9tRP2Km1CzvKsyE8ml8R0.jpg",
  "owner": "client",
  "visibility": "public",
  "path": "client/8BgXSCaMZae9auk1kVA9tRP2Km1CzvKsyE8ml8R0.jpg",
  "mime": "image/jpeg",
  "size": 142083,
  "lastModified": 1640104826
}
Response examples (200)
{
  "name": "8BgXSCaMZae9auk1kVA9tRP2Km1CzvKsyE8ml8R0.jpg",
  "owner": "client",
  "visibility": "public",
  "path": "client/8BgXSCaMZae9auk1kVA9tRP2Km1CzvKsyE8ml8R0.jpg",
  "mime": "image/jpeg",
  "size": 142083,
  "lastModified": 1640104826
}
Response examples (500)
{
  "message": "An error occurred.",
  "code": 500
}
Response examples (500)
{
  "message": "An error occurred.",
  "code": 500
}