Orgs
The 15 operations under orgs, as typed calls on the generated REST client.
Orgs
Available from @codespar/sdk 0.12.0; the version on npm is 0.12.0. Every example on this page is compiled against the installed package when these docs build: a call that does not type-check fails the build.
Every call below is cs.api reaching one operation of the OpenAPI document this page was generated from; the REST client overview explains request, response, the option bag and the errors. The values are placeholders shaped by the document.
import { } from "@codespar/sdk";
const = new ({ : .. });POST /v1/orgs/{orgId}/agents
/v1/orgs/{orgId}/agentsRegister an agent identity and mint its first signing key
const = await ..("post", "/v1/orgs/{orgId}/agents", {
: {
: "org_0000000000000000"
},
: {
: "agt_0000000000000000",
: "Example",
: "string"
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: POST /v1/orgs/{orgId}/agents in the HTTP reference.
POST /v1/orgs/{orgId}/agents/{agentId}/keys/rotate
/v1/orgs/{orgId}/agents/{agentId}/keys/rotateRetire the agent's active key and mint a fresh one
const = await ..("post", "/v1/orgs/{orgId}/agents/{agentId}/keys/rotate", {
: {
: "org_0000000000000000",
: "agt_0000000000000000"
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: POST /v1/orgs/{orgId}/agents/{agentId}/keys/rotate in the HTTP reference.
POST /v1/orgs/{orgId}/agents/{agentId}/keys/{kid}/revoke
/v1/orgs/{orgId}/agents/{agentId}/keys/{kid}/revokeHard-revoke one of an agent's signing keys
const = await ..("post", "/v1/orgs/{orgId}/agents/{agentId}/keys/{kid}/revoke", {
: {
: "org_0000000000000000",
: "agt_0000000000000000",
: "string"
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: POST /v1/orgs/{orgId}/agents/{agentId}/keys/{kid}/revoke in the HTTP reference.
GET /v1/orgs/{orgId}/approvals/health
/v1/orgs/{orgId}/approvals/healthQueue depth and the age of the oldest pending approval
const = await ..("/v1/orgs/{orgId}/approvals/health", {
: {
: "org_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/orgs/{orgId}/approvals/health in the HTTP reference.
GET /v1/orgs/{orgId}/approvals/{id}
/v1/orgs/{orgId}/approvals/{id}Read one approval, including the tool arguments held for review
const = await ..("/v1/orgs/{orgId}/approvals/{id}", {
: {
: "org_0000000000000000",
: "approval_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/orgs/{orgId}/approvals/{id} in the HTTP reference.
GET /v1/orgs/{orgId}/audit/config
/v1/orgs/{orgId}/audit/configRead the chain verification windows and staleness budgets
const = await ..("get", "/v1/orgs/{orgId}/audit/config", {
: {
: "org_0000000000000000"
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: GET /v1/orgs/{orgId}/audit/config in the HTTP reference.
PATCH /v1/orgs/{orgId}/audit/config
/v1/orgs/{orgId}/audit/configUpdate the chain verification windows and staleness budgets
const = await ..("patch", "/v1/orgs/{orgId}/audit/config", {
: {
: "org_0000000000000000"
},
: {
: 0,
: 0,
: 1,
: 0,
: 1,
: 1
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: PATCH /v1/orgs/{orgId}/audit/config in the HTTP reference.
GET /v1/orgs/{orgId}/audit/health
/v1/orgs/{orgId}/audit/healthHow far the chain verifier got, and whether what it walked was linked
const = await ..("get", "/v1/orgs/{orgId}/audit/health", {
: {
: "org_0000000000000000"
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: GET /v1/orgs/{orgId}/audit/health in the HTTP reference.
GET /v1/orgs/{orgId}/audit/incidents
/v1/orgs/{orgId}/audit/incidentsList chain-integrity incidents
const = await ..("get", "/v1/orgs/{orgId}/audit/incidents", {
: {
: "org_0000000000000000"
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: GET /v1/orgs/{orgId}/audit/incidents in the HTTP reference.
POST /v1/orgs/{orgId}/audit/incidents/{id}/acknowledge
/v1/orgs/{orgId}/audit/incidents/{id}/acknowledgeAcknowledge a chain-integrity incident and write the acknowledgement into the chain
const = await ..("post", "/v1/orgs/{orgId}/audit/incidents/{id}/acknowledge", {
: {
: "org_0000000000000000",
: "incident_0000000000000000"
},
: {
: "string",
: "not_required",
: true
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: POST /v1/orgs/{orgId}/audit/incidents/{id}/acknowledge in the HTTP reference.
POST /v1/orgs/{orgId}/data-subjects/{userId}/anonymize
/v1/orgs/{orgId}/data-subjects/{userId}/anonymizeErase a data subject's personal data across the audit chain (LGPD Art. 18)
const = await ..("post", "/v1/orgs/{orgId}/data-subjects/{userId}/anonymize", {
: {
: "org_0000000000000000",
: "user_0000000000000000"
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: POST /v1/orgs/{orgId}/data-subjects/{userId}/anonymize in the HTTP reference.
GET /v1/orgs/{orgId}/mandates
/v1/orgs/{orgId}/mandatesList the org's mandates
const = await ..("/v1/orgs/{orgId}/mandates", {
: {
: "org_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/orgs/{orgId}/mandates in the HTTP reference.
POST /v1/orgs/{orgId}/mandates
/v1/orgs/{orgId}/mandatesIssue an org-side mandate (off by default, see the 501)
const = await ..("post", "/v1/orgs/{orgId}/mandates", {
: {
: "org_0000000000000000"
},
: {
: "agt_0000000000000000",
: "payment",
: "1000",
: "BRL",
: [
"string"
],
: 0
}
});
// r.status is one of the documented statuses (200, 403),
// each with its own body shape in r.data; nothing here throws on 403.
if (.) {
.(.);
}Parameters, body and every documented response: POST /v1/orgs/{orgId}/mandates in the HTTP reference.
GET /v1/orgs/{orgId}/mandates/{id}
/v1/orgs/{orgId}/mandates/{id}Read one mandate with its consumption history
const = await ..("/v1/orgs/{orgId}/mandates/{id}", {
: {
: "org_0000000000000000",
: "mandate_0000000000000000"
}
});Parameters, body and every documented response: GET /v1/orgs/{orgId}/mandates/{id} in the HTTP reference.
POST /v1/orgs/{orgId}/mandates/{id}/revoke
/v1/orgs/{orgId}/mandates/{id}/revokeRevoke a mandate
const = await ..("/v1/orgs/{orgId}/mandates/{id}/revoke", {
: {
: "org_0000000000000000",
: "mandate_0000000000000000"
},
: {
: "string"
}
});Parameters, body and every documented response: POST /v1/orgs/{orgId}/mandates/{id}/revoke in the HTTP reference.