Skip to content

Commits

Environments that require commit run their latest commit. Changes wait as pending changes until someone commits them.

GET/v1/orgs/{org}/projects/{project}/environments/{environment}/pending

getPendingChangesRole: viewer or higher

What committing would change in an environment that requires commit: each difference between what its SDKs run (the latest commit) and the settings as they are now. Empty for an environment that applies changes at once. Review these, then commitEnvironment with working_version.

Parameters

NameInTypeDescription
orgrequiredpathstringThe organization's slug, as in its URL in the app. Example: "snugghome".
projectrequiredpathstringThe project's slug, as in its URL in the app. Example: "snugghome-app".
environmentrequiredpathstringThe environment's slug, as in its URL in the app. Example: "production".

Example request

Terminal window
curl https://api.spanslice.com/v1/orgs/snugghome/projects/snugghome-app/environments/production/pending \
-H "Authorization: Bearer $SPANSLICE_TOKEN"

Response 200

GetPendingChangesResponse

Example response
{
"environment": "production",
"requires_commit": true,
"working_version": "5f0c2e9a41d3b7c8",
"committed": {
"message": "Sample checkout at 1 in 10",
"created_at": "2026-10-07T09:12:44.000Z",
"by": "Ada"
},
"changes": [
{
"id": "WyJydWxlIiwiYWRkZWQiLDE3LG51bGxd",
"kind": "rule",
"change": "added",
"rule": "rule_RVeVNOTP",
"services": [
"Api",
"Main"
],
"after": {
"key": "ZWMVUY0p",
"name": "Drop health checks",
"stage": "created",
"target": "root"
},
"revertible": true
}
]
}

Errors

StatusCodeWhen
400invalid_requestThe request is invalid; errors says where.
401unauthorizedThe access token is missing, unknown, expired or revoked.
404not_foundIt doesn't exist, or this token can't reach it.

POST/v1/orgs/{org}/projects/{project}/environments/{environment}/commits

commitEnvironmentRole: member or higher

Makes the environment's SDKs run its settings as they are now: every pending change at once. Only for environments that require commit. Commits are how changes reach production there, so commit only what a person asked for or approved.

Parameters

NameInTypeDescription
orgrequiredpathstringThe organization's slug, as in its URL in the app. Example: "snugghome".
projectrequiredpathstringThe project's slug, as in its URL in the app. Example: "snugghome-app".
environmentrequiredpathstringThe environment's slug, as in its URL in the app. Example: "production".

Request body

CommitEnvironmentRequest, required.

Example request

Terminal window
curl -X POST https://api.spanslice.com/v1/orgs/snugghome/projects/snugghome-app/environments/production/commits \
-H "Authorization: Bearer $SPANSLICE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"working_version": "5f0c2e9a41d3b7c8",
"message": "Drop health checks"
}'

Response 201

Commit

Example response
{
"message": "Drop health checks",
"created_at": "2026-10-08T14:20:01.000Z",
"by": "Ada"
}

Errors

StatusCodeWhen
400invalid_requestThe environment doesn't require commit; its changes already apply.
401unauthorizedThe access token is missing, unknown, expired or revoked.
403forbiddenThe token's role is too low for this operation.
404not_foundIt doesn't exist, or this token can't reach it.
409conflictThe settings changed since working_version; review the pending changes again.

POST/v1/orgs/{org}/projects/{project}/environments/{environment}/pending/{change}/revert

revertChangeRole: member or higher

Undoes one pending change, putting that setting back as the latest commit has it. Other environments that share the setting (rules are shared) change too, as they would in the app.

Parameters

NameInTypeDescription
orgrequiredpathstringThe organization's slug, as in its URL in the app. Example: "snugghome".
projectrequiredpathstringThe project's slug, as in its URL in the app. Example: "snugghome-app".
environmentrequiredpathstringThe environment's slug, as in its URL in the app. Example: "production".
changerequiredpathstringA pending change's id.

Request body

RevertChangeRequest, required.

Example request

Terminal window
curl -X POST https://api.spanslice.com/v1/orgs/snugghome/projects/snugghome-app/environments/production/pending/{change}/revert \
-H "Authorization: Bearer $SPANSLICE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"working_version": "5f0c2e9a41d3b7c8"
}'

Response 204

No content.

Errors

StatusCodeWhen
400invalid_requestThe change is to an organization-wide setting, which only its own settings page changes.
401unauthorizedThe access token is missing, unknown, expired or revoked.
403forbiddenThe token's role is too low for this operation.
404not_foundIt doesn't exist, or this token can't reach it.
409conflictThe settings changed since working_version; review the pending changes again.