Offboard: revoke this partner's keys and clear the managed-by link
const url = 'https://api.emite.cr/v1/partner/tenants/example/detach';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"orphan":false}'};
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://api.emite.cr/v1/partner/tenants/example/detach \ --header 'Content-Type: application/json' \ --data '{ "orphan": false }'Requires the tenant to have an owner membership (grant-access completed) OR an explicit orphan: true acknowledgment (409 PARTNER_DETACH_REQUIRES_OWNER otherwise). Revokes, with no grace, every data-plane key this partner minted for the company, and clears the link: the company leaves this partner's plan and count, its events stop reaching this partner's webhooks, and its /partner/tenants/:id routes answer 404. Fiscal history is never deleted.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Partner app credential (ecp_*)
Request Bodyrequired
Section titled “Request Bodyrequired”object
Acknowledgment required to detach a company that has no owner yet (grant-access never completed): nobody could reach its fiscal history afterwards. Without it, such a detach answers 409 PARTNER_DETACH_REQUIRES_OWNER.
Responses
Section titled “Responses”object
Always true: this partner no longer manages the company, and its routes under /partner/tenants/:id answer 404 PARTNER_TENANT_NOT_FOUND from now on.
How many data-plane keys this partner had minted for the company, in both environments, that still worked — one in a rotation grace included — and stopped working with this call.
Example
{ "detached": true, "revokedKeys": 2}