API key limits\
- You can only have five active API key pairs at once.
- Your account will always have at least one active pair of standard API keys.
- Standard keys: A standard API key has read and write access to all the APIs listed above.
- Restricted key: A restricted API key allows only the minimum level of access that you specify across all the APIs listed above. The three access levels are:
Read only, and
Read and write. For example, if you set
Read onlypermission for media access for your restricted key, you cannot use it to perform any upload, update, or delete operation. You can only perform operations like list and search files, get file details, get file metadata, etc.
The API keys section in Developer options
It is strongly recommended to keep your private key safe and confidential. To help keep your API keys secure, follow these best practices:
- 1.Do not embed API keys directly in your code. API keys that are embedded in code can be accidentally exposed to the public. For example, you may forget to remove the keys from the code that you share. Instead of embedding your API keys in your applications, store them in environment variables or in files outside of your application's source tree.
- 2.Do not store API keys in files inside your application's source tree. If you store API keys in files, keep the files outside your application's source tree to help ensure your keys do not end up in your source code control system. This is particularly important if you use a public source code management system such as GitHub.
If an API key is compromised, you should roll that pair immediately and start using the newly generated keys. The newly generated pair has the same resource access permissions as the old one.
You can choose when to expire the existing key:
- In 1 hour
- In 24 hours
- In 3 days
- In 7 days
The expiry period you choose blocks and expires the existing key after the time period you specify. Regardless of the expiry period, you can use the new key immediately.
Roll API keys
You can delete any existing API key in your account. However, your account will always have at least one pair of active standard keys.
By default, the private key is masked for security reasons. You can click on the reveal icon next to the private key and enter your password to authorize and reveal the private keys.
- Create a new restricted API key and specify its resource access permissions.
- Update resource access permissions on any existing restricted API keys.
Create restricted API keys
The three access levels across any resource are:
Read only, and
Read and write.
- Media access: Permissions for operations on Upload, Media management, File metadata, and Custom metadata management APIs.