Pin a suggested change's version for its project
const url = 'https://example.com/v1/suggested-changes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/pin';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"reason":"example","stopFollowingLatest":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/suggested-changes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/pin \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "reason": "example", "stopFollowingLatest": true }'A pin of its version for its project, with its check’s test run, through the project’s gate: as POST /v1/agents/{agentId}/pinned/pin answers. A project on Latest takes the change as its Latest (add-as-latest); a pin there is refused with 409 pin-stops-latest, before any rebuild, unless the body has stopFollowingLatest: true, which takes the project off Latest. Under kindgi dev, a suggested change is for the whole workspace (the tenant scope): it’s pinned there, through the project its version was made in. Needs pin on the agent. Allowed from ready.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Body
Section titled “Request Body”object
Examplegenerated
{ "reason": "example", "stopFollowingLatest": true}Responses
Section titled “Responses”Pinned: the pin, as POST /v1/agents/{agentId}/pinned/pin answers it, with the suggested change, pinned.
A suggested change’s pin, as PinAnswer, and the suggested change it pinned.
object
Example
{ "pin": { "scope": { "kind": "tenant" }, "action": "pin", "requestedBy": { "kind": "user" }, "status": "pinned" }, "suggestedChange": { "madeBy": { "kind": "improve-run", "by": { "kind": "user" } }, "changes": [ { "kind": "block" } ], "check": { "status": "not-started" }, "status": "checking", "note": { "kind": "gate-refused" }, "pinned": { "by": { "kind": "user" } }, "addedAsLatest": { "by": { "kind": "user" } }, "withdrawn": { "by": { "kind": "user" } } }}The gate passed and an approval is open: the pin, with the suggested change, waiting-for-second-person.
A suggested change’s pin, as PinAnswer, and the suggested change it pinned.
object
Example
{ "pin": { "scope": { "kind": "tenant" }, "action": "pin", "requestedBy": { "kind": "user" }, "status": "pinned" }, "suggestedChange": { "madeBy": { "kind": "improve-run", "by": { "kind": "user" } }, "changes": [ { "kind": "block" } ], "check": { "status": "not-started" }, "status": "checking", "note": { "kind": "gate-refused" }, "pinned": { "by": { "kind": "user" } }, "addedAsLatest": { "by": { "kind": "user" } }, "withdrawn": { "by": { "kind": "user" } } }}Malformed request body. Or reference-out-of-scope: the suggested change’s project no longer reaches the agent (details.issues).
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" }}permission-denied: the caller may not make this change. When its project now runs another version, it’s rebuilt there first, and that rebuild’s check can answer plan-limit-reached: this adds flows or agents to production past the most this runtime’s license key runs, so none of them is added; what runs keeps running. details has projectId (on a reinstate, when its version records one); over, each count over (flows first) with its limit (flows or agents), the number it adds (adding), and the key’s plan, most and inUse when they count this workspace alone; the first of them again at the top (details.limit, …); newIds, the flows and agents it adds; and next, where a larger plan is, when the runtime names one. Here it’s the agent version a check makes that counts, in the project it’s made in. The suggested change and its edit’s block version are kept, as a failed check keeps them. Without an authorization store, key-project-mismatch (details.keyProjectId): the API key or session is limited to a project, and this writes above it, to the workspace, an org or a team (with a store, that is permission-denied). Without an authorization store, key-project-mismatch (details.keyProjectId, details.projectId): the API key or session is limited to a project, and this acts in another one, the record’s or its agent’s or test set’s (with a store, that is permission-denied, or the record isn’t found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No such suggested change; or project-not-found: its project is deleted.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}suggested-change-invalid-state-transition: its status doesn’t allow it. suggested-change-not-for-a-project: it was made before suggested changes were for a project, so it can only be withdrawn. pin-stops-latest: its project follows Latest, and the body doesn’t have stopFollowingLatest: true; details.projects has { projectId, version } with the version it runs now, and details.suggestedChangeId. suggested-change-out-of-date: its project now runs another version than the one it’s built on, so it’s being rebuilt there and checked again (details.rebuilding), or it can’t be. 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" }}gate-failed: the gate refused it (the error carries the checks and suggestedChangeId, and, with the gate’s cases rule, passing, needs and newlyFailing as the agent pin does). The suggested change stays ready, with a note.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}plan-count-busy (with Retry-After): counting the flows and agents in production took too long, so none of them is added; a retry is safe. The suggested change and its edit’s block version are kept, as a failed check keeps them. Or idempotency-store-unavailable (with Retry-After): the Idempotency-Key store couldn’t be read before the request ran, so nothing was changed. 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. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/suggested-changes/{suggestedChangeId}: Fetch a suggested changePOST /v1/suggested-changes/{suggestedChangeId}/check: Check a suggested change againPOST /v1/suggested-changes/{suggestedChangeId}/add-as-latest: Add a suggested change's version as its project's LatestPOST /v1/suggested-changes/{suggestedChangeId}/withdraw: Withdraw a suggested change- Suggest a change, and test it
- Kindgi 0.4.0
- Error code
authz-backend-unavailable - Error code
database-busy - Error code
gate-failed - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
key-project-mismatch - Error code
permission-denied - Error code
pin-stops-latest - Error code
plan-count-busy - Error code
plan-limit-reached - Error code
project-not-found - Error code
rate-limit-exceeded - Error code
reference-out-of-scope - Error code
request-too-large - Error code
suggested-change-invalid-state-transition - Error code
suggested-change-not-for-a-project - Error code
suggested-change-out-of-date - Error code
tenant-state-unavailable - Every error code