Skip to content

API reference

API: Agency workspaces

Markdown version

MethodPathWhat it doesScope
GET/v1/agency/clientsClient workspaces this agency manages, each with its monthly credit cap and this month's credits used; the pool they share; and the agency managing this organization, if anysettings:read
POST/v1/agency/clientsAdd a client workspace: an organization you also own, with its share of the pool as its monthly credit cap (owners, Agency plan) (web app only)settings:write
DELETE/v1/agency/clients/:idStop managing a client workspace: its data stays in its own organization, which goes back to its own plan's credits (owners) (web app only)settings:write
GET/v1/agency/clients/:idOne client workspace's report: its cap and this month's credits by module (totals only)settings:read
PATCH/v1/agency/clients/:idRename a client workspace or change its share of the pool (owners of the agency; the change is in the client's audit log too) (web app only)settings:write
GET/v1/agency/link-offersThis agency's invitations to client organizations and where each stands (never the codes)settings:read
POST/v1/agency/link-offersInvite a client organization: a one-time code, shown once, that the client's owner accepts within 7 days (owners, Agency plan) (web app only)settings:write
DELETE/v1/agency/link-offers/:idWithdraw an open invitation (owners) (web app only)settings:write
POST/v1/agency/link-offers/acceptAccept an agency's invitation for this organization to be managed by it (owners of this organization) (web app only)settings:write
POST/v1/agency/link-offers/previewWhat an agency's invitation offers this organization (the agency and the monthly credit cap), before an owner accepts it (web app only)settings:write
DELETE/v1/agency/managed-byEnd the agency's management of this organization (owners of this organization; its data stays, and it goes back to its own plan's credits) (web app only)settings:write

Examples

GET /v1/agency/clients

Client workspaces this agency manages, each with its monthly credit cap and this month's credits used; the pool they share; and the agency managing this organization, if any

curl -s "https://api.tendbrook.com/v1/agency/clients" \
  -H "Authorization: Bearer $EC_API_KEY"
const res = await fetch(`https://api.tendbrook.com/v1/agency/clients`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.EC_API_KEY}` },
});
const data = await res.json();

GET /v1/agency/clients/$ID

One client workspace's report: its cap and this month's credits by module (totals only)

curl -s "https://api.tendbrook.com/v1/agency/clients/$ID" \
  -H "Authorization: Bearer $EC_API_KEY"
const res = await fetch(`https://api.tendbrook.com/v1/agency/clients/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.EC_API_KEY}` },
});
const data = await res.json();

This agency's invitations to client organizations and where each stands (never the codes)

curl -s "https://api.tendbrook.com/v1/agency/link-offers" \
  -H "Authorization: Bearer $EC_API_KEY"
const res = await fetch(`https://api.tendbrook.com/v1/agency/link-offers`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.EC_API_KEY}` },
});
const data = await res.json();

Request and response schemas: https://www.tendbrook.com/openapi.json. All resources: API reference.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.
Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.