List permissions

GET /v1/permissions · permission apis:read

Returns the permissions (OAuth scopes) of one API, newest first, in cursor pages, together with the texts shown on the consent screen. The environment comes from the credential only.

Request

Parameter Type Required Description
api_id string yes The API (api_…). Missing, repeated or malformed gives 422 with pointer /api_id.
limit integer no 1-100, default 20.
after string no Cursor from list_metadata.after. Exclusive with before.
before string no Cursor from list_metadata.before.
order string no asc or desc (default). A cursor is only valid with the same api_id and order.

Response

200 OK

{
  "data": [ {
  "id": "perm_01h455vb4pex5vsknk084sn02s",
  "api_id": "api_01h455vb4pex5vsknk084sn02q",
  "value": "read:orders",
  "display_name": "Read orders",
  "description": "See your past orders and their status",
  "consent_text_i18n": {
    "en": "Read your orders",
    "tr": "Siparişlerinizi okuyun"
  },
  "sensitivity": "normal"
} ],
  "list_metadata": { "before": null, "after": "eyJ2IjoxLi4ufQ" }
}

A permission without consent texts has display_name and description set to null and consent_text_i18n set to {}. A null cursor means there are no more records in that direction. No total count is returned.

Errors

HTTP code When
400 invalid_cursor The cursor is malformed, tampered with, or was issued for another environment, api_id or order.
403 insufficient_permissions The credential lacks apis:read.
404 not_found There is no such API in this environment.
422 validation_failed api_id is missing, repeated or malformed, or another query parameter is invalid.

Example

curl "https://api.eu.keenauth.com/v1/permissions?api_id=api_01h455vb4pex5vsknk084sn02q&limit=20" \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY"