File metadata management
Add additional, arbitrary data associated with uploaded files. For example, you could store user IDs, order IDs, or tags.
Metadata is key-value data. You can specify up to 50 keys, with key names up to 64 characters long and values up to 512 characters long.
Note: Don’t store any sensitive information (bank account numbers, card details, etc.) as metadata.
Examples
Using the File metadata Upload API, you can set the metadata for uploaded files and read the metadata from already uploaded ones. Direct upload request example:
You can modify the metadata through the File metadata REST API (get, update, and delete keys). File metadata is also passed via webhooks. REST API request example:
Get $YOUR_PUBLIC_KEY
and $YOUR_SECRET_KEY
from API keys.
Limitations
File metadata is provided by the end-users uploading the files and can contain symbols unsafe in, for example, HTML context. Please escape the metadata before use according to the rules of the target runtime context (HTML browser, SQL query parameter, etc.). List of allowed characters for the key:
- Latin letters in lower or upper case (a-z,A-Z)
- digits (0-9)
- underscore
_
- a hyphen
-
- dot
.
- colon
:
If there are keys in the metadata with characters not included in this list, then they will be ignored.