Record the env revision a deployment's pack service runs
const url = 'https://example.com/v1/system/tenants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/deployments/example/pack-env';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"revision":"example","held":"pack-env-ambiguous","appliedRevision":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/system/tenants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/deployments/example/pack-env \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "revision": "example", "held": "pack-env-ambiguous", "appliedRevision": "example" }'After giving a ready pack service its values: the revision it now runs. Or, with held, that this revision’s values couldn’t be given (a required one was removed, say), or were given and its new revision didn’t start (pack-env-update-failed): the service keeps what it runs, and the tenant sees the code on the endpoint (packEnvProblem) until a later revision is given. The same code for the same revision keeps the time it was first recorded. Compare-and-set: appliedRevision is the one the service was found running, and another recorded since is pack-env-conflict. A new service’s revision goes with its endpoint instead (packEnvRevision). Takes system:pack-env.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”Recorded: the deployment’s endpoint as its tenant sees it.
Its pack service’s status, when the server routes each pack call to the deployment that shipped the tool (KINDGI_PACK_ROUTING=per-deployment). Absent otherwise, and for a deployment that ships nothing a pack service serves (no tool, and no guardrail check but built-in ones: a pack of agents and flows only), which needs none. pending: no pack service yet, and calls to its tools fail (pack-endpoint-pending) rather than go to another deployment. ready: calls go to its own pack service. cleared: its pack service was taken down, and calls fail (pack-endpoint-cleared); it carries waiting or retired to say whether it comes back. Carries no URL and no token.
object
Example
{ "status": "pending", "waiting": true, "packEnvProblem": { "code": "pack-env-ambiguous" }, "keptFor": [ { "registered": true, "held": true } ]}A malformed body, or a held code not on the list (bad-input).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}A tenant’s key or session (system-principal-required), or a system key without system:pack-env (system-scope-missing).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No such tenant (tenant-not-found), or no such deployment in it (deployment-not-found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The tenant is closing (tenant-closing); the endpoint isn’t ready (endpoint-not-ready, with details.status); another revision was recorded since (pack-env-conflict, with details.appliedRevision). Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The server doesn’t give a pack service its declared env: its pack services take theirs from how they’re run (pack-env-unsupported).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The operator’s access record can’t be written, so nothing was done (access-record-unavailable), or the Idempotency-Key store couldn’t be read before the request ran (idempotency-store-unavailable, with Retry-After). Or the authorization store couldn’t be reached (authz-backend-unavailable, with Retry-After), or the database was too busy for the authorization check (database-busy, with Retry-After), so the request wasn’t run.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/system/tenants/{tenantId}/deployments/{deploymentId}/pack-env: Read the env a deployment's pack service is to be givenGET /v1/system/tenants: List tenantsPOST /v1/system/tenants: Create a tenantGET /v1/system/tenants/{tenantId}: Read a tenant- Error code
access-record-unavailable - Error code
authz-backend-unavailable - Error code
bad-input - Error code
database-busy - Error code
deployment-not-found - Error code
endpoint-not-ready - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
pack-env-conflict - Error code
pack-env-unsupported - Error code
request-too-large - Error code
system-principal-required - Error code
system-scope-missing - Error code
tenant-closing - Error code
tenant-not-found - Every error code