Ana içeriğe geç

Consumer Organization Actions

Endpoints​

MethodPathDescription
POST/consumer-organizations/{code}/actions/suspendStop the traffic of the organization and the organizations below it; reversible
POST/consumer-organizations/{code}/actions/resumeLift the suspension and re-enable exactly the consumers the suspend disabled
POST/consumer-organizations/{code}/actions/revoke-credentialsPermanently revoke the organization's consumers and every token issued before the call

All three are under /apiops/projects/{projectName}, take no request body, require a Personal API Access Token (Authorization: Bearer YOUR_TOKEN) and answer 200 OK with the organization, in the shape of Get Consumer Organization.

Suspend and resume​

Both actions are idempotent: suspending a suspended organization, or resuming an active one, repeats safely and needs no Idempotency-Key header. The organization's suspended field is true after a suspend and false after a resume.

While the organization is suspended, the gateway refuses every consumer of it and of the organizations below it, and their API clients. Suspend also disables and redeploys the enabled consumers of the organization's applications. A consumer that was already disabled before the suspend stays disabled after the resume, because resume re-enables exactly the consumers the suspend disabled.

Revoke credentials​

Warning

revoke-credentials is one-way. Each consumer it revokes answers 409 lifecycleConflict (params.reason = consumerRevoked) to a later enable, resume or update. There is no undo and no resume.

The action revokes the consumers filed under the organization and the consumers of its applications, also those already disabled. A consumer of an organization below it is not revoked: tokens issued to the API clients below the organization before the call stop working, and those clients can take new tokens. The applications stay; their API clients can take new tokens too.

The answer carries one extra field:

FieldTypeDescription
revokedCredentialCountintegerHow many consumers this call revoked; a repeated call counts 0. Present on the answer of revoke-credentials only

Administration project and portal roles​

Unlike the rest of this API, these actions are also accepted on the administration project's path (/apiops/projects/admin/consumer-organizations/{code}/actions/...), where portal organizations live. Who passes depends on the organization and on everything below it, because the actions reach the consumers, applications and API clients of the organizations below it too:

CallerOrganization of the project, with no portal application and no record of another project below itAny other organization
System Administrator, Portal Business, Portal ManagerPasses, for any organization, on the project path or on admin, without project membershipPasses, same as the left column
Project Identity MANAGEPasses, on the organization of that project, organizations below it included403 permissionDenied (params.reason = portalRoleRequired); nothing is changed
Any other caller404 resourceNotFound404 resourceNotFound

Errors​

StatusError keyCause
403permissionDeniedThe caller passes only through the project's IDENTITY + MANAGE permission, and the organization or an organization below it holds a portal application or a record filed under another project (params.reason = portalRoleRequired); nothing is changed
404resourceNotFoundThe code is unknown, or the project is outside the scope of the caller

cURL Example​

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/consumer-organizations/acme-partners/actions/suspend" \
-H "Authorization: Bearer YOUR_TOKEN"

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/consumer-organizations/acme-partners/actions/revoke-credentials" \
-H "Authorization: Bearer YOUR_TOKEN"

Permissions​

  • User must have IDENTITY + MANAGE permission in the project, or hold the System Administrator, Portal Business or Portal Manager role
  • A project outside the scope of the caller answers 404 resourceNotFound, never 403; the 403 above is the only one these actions return