| title | API Key Commands |
|---|---|
| description | Learn about APIKEY commands in SQLite Cloud. |
| category | reference |
| status | publish |
| slug | api-key-commands |
The CREATE APIKEY USER command creates a new APIKEY associated to a specific username and with a mnemonic name. The RESTRICTION option is currently unused and an expiration date can be set using the EXPIRATION parameter.
It returns a String with the new APIKEY.
CREATE APIKEY USER **username** NAME **key_name** [RESTRICTION **restriction_type**] [EXPIRATION **expiration_date**]USERADMINThe LIST APIKEYS command retrieves all the APIKEYS created on the server. The USER parameter can be used to filter the result further.
It returns a Rowset with the following columns:
- username: user name
- key: API KEY
- name: mnemonic name
- creation_date: API KEY creation date and time
- expiration_date: API KEY expiration date and time (if any)
- restriction: always 0 in this version
LIST APIKEYS [USER username]
USERADMINThe LIST MY APIKEYS command returns a list of all the APIKEYs associated with the username used in the current connection.
It returns a Rowset with the following columns:
- username: user name
- key: API KEY
- name: mnemonic name
- creation_date: API KEY creation date and time
- expiration_date: API KEY expiration date and time (if any)
- restriction: always 0 in this version
LIST APIKEYS [USER username]
USERADMINThe SET KEY command sets or updates a keyname to a specific keyvalue. Once set, the server immediately uses the updated value (and automatically distributes it on the cluster).
It returns OK string or error value (see SCSP protocol).
SET KEY keyname TO keyvalue
SETTINGSThe REMOVE APIKEY command permanently removes an APIKEY from the server.
It returns OK string or error value (see SCSP protocol).
REMOVE APIKEY key
USERADMIN