Vault APIs
Vault variables are a secure way to store and manage sensitive information, such as API keys, passwords, tokens, and secret credentials. Use these APIs to create and manage vault variables instead of hardcoding secrets in your integrations, you reference the vault variable by using its name.
GET - List vault variables
Retrieves the list of all vault variables.
- URL
../apis/v2/rest/configurations/variables- Parameters
- None
- Request headers
-
Content-Type: application/json X-INSTANCE-API-KEY: <generated API key> - Request body
- None
- Response
-
If successful, the response code is as follows:
[ { "key": "<vault_variable_key>", "value": "vault_variable_key", "isPassword": <type_of_vault_variable> } ]
GET - Get vault variables
Retrieves the details of a specific vault variable.
- URL
../apis/v2/rest/configurations/variables/{variable_name}- Parameters
-
- {variable_name} - Name of the variable.
- Request headers
-
Content-Type: application/json X-INSTANCE-API-KEY: <generated API key> - Request body
- None
- Response
-
If successful, the response code is as follows:
[ { "key": "<vault_variable_key>", "value": "<vault_variable_value>", "isPassword": <type_of_vault_variable>, "references": { "<projectName>": { "value": "<value_of_variable_in_project>", "isSync": <sync_status> } } } ]
POST - Create vault variables
Create a vault variable.
- URL
../apis/v2/rest/configurations/variables- Parameters
- None
- Request headers
-
Content-Type: application/json X-INSTANCE-API-KEY: <generated API key> - Request body
-
{ "key": "<vault_variable_key>", "value": "<vault_variable_value>", "isPassword": <type_of_vault_variable> } - Response
-
If successful, the response code is as follows:
{ "key": "<vault_variable_key>", "value": "<vault_variable_value>", "isPassword": <type_of_vault_variable> }
PUT - Update vault variables
Update a vault variable.
- URL
../apis/v2/rest/configurations/variables/{variable_name}- Parameters
-
- {variable_name} - Name of the variable.
- Request headers
-
Content-Type: application/json X-INSTANCE-API-KEY: <generated API key> - Request body
-
{ "value": "<value_to_be_updated>" } - Response
-
If successful, the response code is as follows:
{ "key": "<vault_variable_key>", "value": "<vault_variable_updated_value>", "isPassword": <type_of_vault_variable> }
DELETE - Delete vault variables
Delete a vault variable.
- URL
../apis/v2/rest/configurations/variables/{variable_name}- Parameters
-
- {variable_name} - Name of the variable.
- Request headers
-
Content-Type: application/json X-INSTANCE-API-KEY: <generated API key> - Request body
- None
- Response
- None
POST - Sync vault variables
Synchronize the vault variables to the linked project’s variables.
- URL
../apis/v2/rest/configurations/variables/{variable_name}/sync?projects={list_of_projects}- Parameters
-
- {variable_name} - Name of the variable.
<list_of_projects>- List of projects to sync the value in specific projects. If the variable is present in the project, then it syncs. Else, it creates a new variable in the project. If the project list is empty, then it syncs in the projects where the vault variable is already linked. You can enter multiple project names that are separated by a comma.Note:- Do not pass
projectsquery parameter to sync the value in all the linked projects. - If unlinked projects are passed, the variable is created in those projects.
- Do not pass
- Request headers
-
Content-Type: application/json X-INSTANCE-API-KEY: <generated API key> - Request body
- None
- Response
-
If successful, the response code is as follows:
{ "code": <status_of_sync> }If an error occurs, the response is as follows:{ "output": { "code": -1, "description": "The variable testVar1 could not be updated in the listed projects.", "details": { "key": "testVar1", "UnknownProjects": ["a"] } } }