Tokens and Permissions
Create token
Creates a new token in the project. Note that it is not possible to create a new master token.
If your admin token does not have the canManageTokens permission, you can only create a temporary token with minimal privileges. In this case, you are allowed to set the description and token expiration via the expiresIn parameter. All other attributes will be ignored.
Creating a token with canManageProtectedDefaultBranch additionally requires an application token with scope storage:tokens:create-protected-default-branch-privileged in the X-KBC-ManageApiToken header.
post/v2/storage/tokens
Request
- Base URLhttps://connection.keboola.com
- Auth
- API key in header X-StorageApi-Token
- or API key in header X-KBC-ManageApiToken
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"description": "my-new-token",
"bucketPermissions": {
"in.c-main": "read"
},
"componentAccess": [
"keboola.ex-db-mysql"
],
"expiresIn": 60
}Response
Created token including its decrypted token value.
Example response
{
"id": "484",
"created": "2017-02-13T12:01:05+0100",
"refreshed": "2017-02-13T12:01:05+0100",
"description": "my-new-token",
"uri": "https://connection.keboola.com/v2/storage/tokens/484",
"dailyCapacity": 5,
"token": "75-12d4bfa4995694a1c956e7bb1eea0df5cc53acdb",
"creatorToken": {
"id": 1,
"description": "dev@keboola.com"
},
"componentAccess": [
"keboola.ex-db-mysql"
],
"bucketPermissions": {
"in.c-main": "read"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.