Vault API Definition

The Vault API lets services export or manage secrets in a project. Paths are relative to the API base URL, such as https://cloud.getgitops.com/api.

Authentication

Send a project-scoped API key as a bearer token with every request:

Authorization: Bearer <api-key>

The API key must belong to the requested project and have the permission required by the endpoint. Session authentication is also supported for signed-in users with the same permission.

All paths are normalized: /, /database, and /services/payments are valid. API responses use JSON unless noted otherwise. Validation failures return 400, missing projects, folders, or secrets return 404, and unauthorized requests return 403.

Export secrets

GET /vault/export

Exports every secret in one folder and environment. Requires project:vault:secrets:export.

Query parameterRequiredDescription
projectIdYesProject UUID.
envYesEnvironment slug, such as production.
pathNoFolder path. Defaults to /.
formatNoExport format: env or json. Defaults to env.

The response is an attachment with Cache-Control: no-store: text/plain for env or application/json for json.

curl --request GET 
	--header "Authorization: Bearer $GOPS_API_KEY" 
	"https://cloud.getgitops.com/api/vault/export?projectId=$PROJECT_ID&env=production&path=/database&format=env"

Create a secret

POST /vault/secret

Creates a secret in a folder. Requires project:vault:secrets:create.

JSON fieldRequiredDescription
projectIdYesProject UUID.
keyYesSecret key, such as DATABASE_URL.
pathNoFolder path. Defaults to /. The folder must exist.
descriptionNoDescription of the secret.
valuesNoObject mapping environment slugs to secret values.

Returns 201 with { "secret": ... }.

curl --request POST https://cloud.getgitops.com/api/vault/secret 
	--header "Authorization: Bearer $GOPS_API_KEY" 
	--header "Content-Type: application/json" 
	--data '{
		"projectId": "'"$PROJECT_ID"'",
		"path": "/database",
		"key": "DATABASE_URL",
		"description": "Primary database connection",
		"values": { "production": "postgres://..." }
	}'

Read a secret

GET /vault/secret/:key

Returns a secret by key and folder. Requires project:vault:secrets:read.

Query parameterRequiredDescription
projectIdYesProject UUID.
pathNoFolder path. Defaults to /.

Returns 200 with { "secret": ... } or 404 when the key is not present in that folder.

curl --request GET 
	--header "Authorization: Bearer $GOPS_API_KEY" 
	"https://cloud.getgitops.com/api/vault/secret/DATABASE_URL?projectId=$PROJECT_ID&path=/database"

Update a secret

PATCH /vault/secret/:key

Sets a secret value for one environment. The secret key and folder cannot be changed. Requires project:vault:secrets:update.

Query parameterRequiredDescription
projectIdYesProject UUID.
pathNoFolder path. Defaults to /.
JSON fieldRequiredDescription
environmentYesEnvironment slug whose value changes.
valueYesNew secret value.
descriptionNoReplacement secret description.

Returns 200 with { "secret": ... }; the returned secret includes the updated value but does not expose all environment values.

curl --request PATCH "https://cloud.getgitops.com/api/vault/secret/DATABASE_URL?projectId=$PROJECT_ID&path=/database" 
	--header "Authorization: Bearer $GOPS_API_KEY" 
	--header "Content-Type: application/json" 
	--data '{ "environment": "production", "value": "postgres://..." }'

Delete a secret

DELETE /vault/secret/:key

Deletes a secret by key from a folder. Requires project:vault:secrets:delete.

Query parameterRequiredDescription
projectIdYesProject UUID.
pathNoFolder path. Defaults to /.

Returns 200 with { "success": true }.

curl --request DELETE 
	--header "Authorization: Bearer $GOPS_API_KEY" 
	"https://cloud.getgitops.com/api/vault/secret/DATABASE_URL?projectId=$PROJECT_ID&path=/database"