Vaults API¶
Create a Vault¶
- POST /v1/vaults¶
Create a Vault. NAME must be unique for the account.
Form Parameters: - name – string(req’d) - Vault name
Request Headers: - Authorization – API_KEY or ACCESS_TOKEN
Status Codes: - 200 OK – success
- 400 Bad Request – missing or duplicate Vault name
Example Request
curl https://api.truevault.com/v1/vaults \ -X POST \ -u [API_KEY | ACCESS_TOKEN]: \ -d "name=test_vault"
Example Response
{ "result": "success", "transaction_id": "00000000-0000-0000-0000-000000000000", "vault": { "id": "00000000-0000-0000-0000-000000000000", "name": "test_vault" } }
Read a Vault¶
- GET /v1/vaults/(string: vault_id)¶
Retrieve a Vault by ID. Returns the name of the Vault.
Parameters: - vault_id – string(req’d)
Request Headers: - Authorization – API_KEY or ACCESS_TOKEN
Status Codes: - 200 OK – success
- 404 Not Found – Vault does not exist
Example Request
curl https://api.truevault.com/v1/vaults/00000000-0000-0000-0000-000000000000 \ -X GET \ -u [API_KEY | ACCESS_TOKEN]:
Example Response
{ "result": "success", "transaction_id": "00000000-0000-0000-0000-000000000000", "vault": { "id": "00000000-0000-0000-0000-000000000000", "name": "test_vault" } }
List all Vaults¶
- GET /v1/vaults¶
Retrieves all Vaults authorized for the User.
Query Parameters: - page – int(optional, default: 1) - page number in paginated response
- per_page – int(optional, default: 100) - results per page in paginated response
Request Headers: - Authorization – API_KEY or ACCESS_TOKEN
Status Codes: - 200 OK – success
Example Request
curl https://api.truevault.com/v1/vaults?page=3&per_page=15 \ -X GET \ -u [API_KEY | ACCESS_TOKEN]:
Example Response
{ "result": "success", "transaction_id": "00000000-0000-0000-0000-000000000000", "vaults": [ { "id": "00000000-0000-0000-0000-000000000000", "name": "test_vault_0" }, { "id": "00000000-0000-0000-0000-000000000000", "name": "test_vault_1" } ] }
Update a Vault¶
- PUT /v1/vaults/(string: vault_id)¶
Updates a Vault.
Parameters: - vault_id – string(req’d)
Form Parameters: - name – string(optional) - new Vault name
Request Headers: - Authorization – API_KEY or ACCESS_TOKEN
Status Codes: - 200 OK – success
- 404 Not Found – Vault does not exist
Example Request
curl https://api.truevault.com/v1/vaults/00000000-0000-0000-0000-000000000000 \ -X PUT \ -u [API_KEY | ACCESS_TOKEN]: \ -d "name=test_vault_0"
Example Response
{ "result": "success", "transaction_id": "00000000-0000-0000-0000-000000000000", "vault": { "id": "00000000-0000-0000-0000-000000000000", "name": "test_vault_0" } }
Delete a Vault¶
- DELETE /v1/vaults/(string: vault_id)¶
Deletes an empty Vault by ID.
Parameters: - vault_id – string(req’d)
Request Headers: - Authorization – API_KEY or ACCESS_TOKEN
Status Codes: - 200 OK – success
- 404 Not Found – Vault does not exist
Example Request
curl https://api.truevault.com/v1/vaults/00000000-0000-0000-0000-000000000000 \ -X DELETE \ -u [API_KEY | ACCESS_TOKEN]:
Example Response
{ "result": "success", "transaction_id": "00000000-0000-0000-0000-000000000000", "vault": { "id": "00000000-0000-0000-0000-000000000000", "name": "test_vault_0" } }