Update a file

Request

Updates a file with a specified ID.

Note: Files can only be uploaded by POST request. For more information, see the Create a file operation.

Security
SecretApiKey or JWT
Path
idstring, <= 50 characters^[@~\-\.\w]+$required
ID of the resource.
Bodyapplication/jsonrequired
File resource.
namestring, <= 255 characters
Original file name.
extensionstring
File extension.
descriptionstring, <= 255 characters
Description of the file.
sourceTypestring or null
Source of the file.
Enum:"upload""camera""organization-export""organization-closure-export"null
Example:"upload"
tagsArray of strings
List of tags associated with the file.
isPublicboolean

Specifies if the file is available publicly without authentication. If this value is true, the permalink and cdn links in the _links section contain the public URLs. The cdn link is served from a cache and accepts the imageSize query parameter for images. If the organization has a verified media domain with no verification failure, the cdn link uses that domain. For more information, see Configure a custom domain.

curl -i -X PUT \
  'https://www.rebilly.com/_mock/catalog/all/files/{id}' \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "name": "string",
    "extension": "string",
    "description": "string",
    "sourceType": "upload",
    "tags": [
      "string"
    ],
    "isPublic": true
  }'

Responses

File updated.
Headers
Rate-Limit-Limitinteger

Maximum number of requests available at one time for this rate limit. For more information, see Rate limits.

Example:500
Rate-Limit-Remaininginteger

Number of requests still available for this rate limit. For more information, see Rate limits.

Example:499
Bodyapplication/json
idstring, <= 50 charactersread-only
ID of the file.
Example:"file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N"
namestring, <= 255 characters
Original file name.
extensionstring
File extension.
descriptionstring, <= 255 characters
Description of the file.
sourceTypestring or null
Source of the file.
Enum:"upload""camera""organization-export""organization-closure-export"null
Example:"upload"
tagsArray of strings
List of tags associated with the file.
mimestringread-only
MIME type of the file.
Enum:"image/png""image/jpeg""image/gif""image/webp""image/svg+xml""application/pdf""application/json""application/zip""text/csv"
sizeintegerread-only
File size, in bytes.
widthinteger or nullread-only
Width of the image. This field is applicable to images only.
heightinteger or nullread-only
Height of the image. This field is applicable to images only.
sha1stringread-only
Hash sum of the file.
exifDataobject or nullread-only
Collection of EXIF tags contained in the image metadata. This field is applicable to images only.
Example:
{ "FileSize": 120, "Software": "GIMP 2.4.5" }
createdTimestring, (date-time)(CreatedTime)read-only
Date and time when the resource is created. This value is set automatically when the resource is created.
updatedTimestring, (date-time)(UpdatedTime)read-only
Date and time when the resource is updated. This value is set automatically when the resource is updated.
isPublicboolean

Specifies if the file is available publicly without authentication. If this value is true, the permalink and cdn links in the _links section contain the public URLs. The cdn link is served from a cache and accepts the imageSize query parameter for images. If the organization has a verified media domain with no verification failure, the cdn link uses that domain. For more information, see Configure a custom domain.

Response
{ "id": "file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N", "name": "string", "extension": "string", "description": "string", "sourceType": "upload", "tags": [ "string" ], "mime": "image/png", "size": 0, "width": 0, "height": 0, "sha1": "string", "exifData": { "FileSize": 120, "Software": "GIMP 2.4.5" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "isPublic": true, "_links": [ { … } ] }