CREATE API_TOKEN
Syntax
CREATE API_TOKEN api_token_name WITH ('token.role_name' = role_name);
Description
You can use an API_TOKEN
for automated systems to access Deltastream. You must renew a token every 90 days. Use ALTER API_TOKEN command to refresh an existing API_TOKEN
.
When you use an API_TOKEN
, it assumes all organizations, roles, and privileges of the creator.
Arguments
api_token_name
This specifies the name of the new API_TOKEN
. This name is used only for managing the API token within the organization.
Token Parameters
Parameter Name
Description
token.role_name
Name of the role the token should use.
Required: Yes Type: String Valid values: See list of existing roles with LIST ROLES.
Examples
Create a new API_TOKEN
The following creates an API_TOKEN
named my_token
.
<no-db>/<no-store># CREATE API_TOKEN my_token WITH ( 'token.role_name' = sysadmin );
+------------+------------+------------+------------------------------------------+------------------------+
| Type | Name | Command | Summary | Token |
+============+============+============+==========================================+========================+
| api_token | my_token | CREATE | api_token my_token was successfully | <api_token_redacted> |
+------------+------------+------------+------------------------------------------+------------------------+
Use an API_TOKEN with cli
$ /deltastream-cli -a [my-access-token]
mydb.public/prod#
Use an API_TOKEN with cli - env property
$ DS_TOKEN=[my-access-token]
$ /deltastream-cli
mydb.public/prod#
Last updated