Ana içeriğe geç

Revoke Consumer Access

Endpoint​

POST /apiops/projects/{projectName}/consumers/{consumerKey}/access/actions/revoke

Revoke is an action and not a DELETE, because the targets travel in a body.

Authentication​

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request​

Path Parameters​

ParameterTypeRequiredDescription
projectNamestringYesProject name
consumerKeystringYesConsumer key, assigned by the installation. Returned as consumerKey by every consumer response

Request Body​

Same body as Grant Consumer Access.

{
"accessList": [
{ "name": "MyAPI", "type": "API_PROXY" }
]
}
FieldTypeRequiredDescription
accessListarrayYesTargets to change. An empty or missing list answers 400 malformedRequest (params.reason = accessListRequired)
accessList[].namestringYesName of an API proxy or API proxy group of the project
accessList[].typestringYesAPI_PROXY or API_PROXY_GROUP
accessList[].expireTimetimestampNoExpiry of the grant. Used by grant

An entry without name or type answers 400 malformedRequest (params.reason = nameAndTypeRequired).

Response​

200 OK as a write response. result is the access list of the consumer after the revoke. A target that is unknown in the project answers 404 resourceNotFound.

cURL Example​

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/consumers/CONSUMER_KEY/access/actions/revoke" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "accessList": [ { "name": "MyAPI", "type": "API_PROXY" } ] }'

Permissions​

  • User must have IDENTITY + MANAGE permission in the project
  • A project outside the scope of the caller answers 404 resourceNotFound, never 403
  • The admin project has no consumers: a call on it answers 400 malformedRequest (params.reason = platformScopeNotSupported)