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
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| consumerKey | string | Yes | Consumer 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" }
]
}
| Field | Type | Required | Description |
|---|---|---|---|
| accessList | array | Yes | Targets to change. An empty or missing list answers 400 malformedRequest (params.reason = accessListRequired) |
| accessList[].name | string | Yes | Name of an API proxy or API proxy group of the project |
| accessList[].type | string | Yes | API_PROXY or API_PROXY_GROUP |
| accessList[].expireTime | timestamp | No | Expiry 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+MANAGEpermission in the project - A project outside the scope of the caller answers
404 resourceNotFound, never403 - The admin project has no consumers: a call on it answers
400 malformedRequest(params.reason=platformScopeNotSupported)