Manage who can access and upload content to your apps.
A signed request is one which came from a trusted source. Requests can be signed either with your private key (for example if the request came from a secure server) or with an authentication token.
Unsigned requests come from anonymous sources, such as client-side code being run by one of your users. Only your public key is required to generate an unsigned request.
Our libraries authorize requests automatically, but you can find instructions on how to sign requests manually in the API documentation.
Each file has a read permission. On an app level, you can choose the read permission newly uploaded files start with, and whether reading anything in the app needs a signed URL.
Read decides who can request and download a file, through its file, data and image URLs (transforms and labels included):
401, even when the app itself allows unsigned links. See signed URLs.Two app settings control reading, and they are not the same thing:
Uploading and changing files is controlled by your keys, not by a setting: anyone with your public key can upload, and changing or deleting a file through the API needs a request signed with your private key.
Requests signed with your private key are permitted to perform any operation on any file. You may wish to grant more granualar permissions without allowing public access to your files. For this, you can generate authentication tokens.
Authentication tokens can also be used to sign requests, but include restrictions on what permissions the request has. They may also specify an expiry date, allowing you to grant elevated permissions for a limited time only.
Our node library includes a function for generating such tokens, but you can do so manually using JWT. To create an authentication token, follow the steps described in the API documentation, but additionally include a payload when signing the token. The payload should be a JSON object, including the following keys:
read boolean | string[]
The files (ids or labels) that this token grants read access to. Providing true is interpreted as 'all files' and providing false is interpreted as 'no files'. Defaults to false.
write boolean | string[]
The files (ids or labels) that this token grants write access to. Providing true is interpreted as 'all files' and providing false is interpreted as 'no files'. Write access includes both updating and deleting. Defaults to false.
upload boolean
Whether or not this token grants permission to upload new files. Defaults to false.