Docs

List my consents

GET
/users/me/consents

Lists what the signed-in user consented to OAuth clients doing, the last answered first, paginated with a cursor. A consent is kept per client and API, with the user's answer for each scope the client was offered.

A client whose answer goes to an https host is not asked again for scopes the user answered for; one that returns to a loopback address is asked each time, with the last answer ticked. revokeMyConsent (DELETE /users/me/consents/{consent_id}) ends one.

With project_id, the consents are listed only when the session belongs to that project.

A token issued for the person reads the consents too, when it carries user.read. A project secret is no person: it is answered 401, as a request without a credential.

Authorization

headerAuthorizationBearer <token>

Scope: user.read

Query Parameters

limit?integer

Maximum number of items to return.

Range1 <= value <= 100
Default20
page_token?string

Token for fetching the next page of results. Obtain this value from next_page_token in the previous response. Omit to start from the beginning. Its format is opaque and may change between releases.

project_id?string

The project the caller signs its users in to. The cookie's session is used only when it belongs to this project; a session of any other project answers 403 with sess.project_mismatch.

A session belongs to one project, while a browser sends its cookie to every app on the same host. An app passes its own project, so that a session of another project never reads or acts as one of its users, and signing out of the app never ends it. The SDKs pass it when they read the session or sign out.

sess.project_mismatch does not mean the session is invalid: it is live in its own project, so keep its cookie.

Match^[a-zA-Z0-9_-]+$

Response Body

The user's consents.

application/json
  1. response

The signed-in user's consents.

consents*array<>
next_page_token?|

Token to pass as page_token in the next request to fetch the following page. Absent when there are no more results.

Example Request
import { configureZitadel, getApi } from "@zitadel/api/config";// In the browser, through the SDK proxy: the session cookie authenticates the call.const api = getApi(configureZitadel({ projectId: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" }));const myConsents = await api.listMyConsents();
Example Response
{  "consents": [    {      "id": "string",      "client_id": "string",      "resource": "string",      "scopes": [        "string"      ],      "declined_scopes": [        "string"      ],      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "expires_at": "2019-08-24T14:15:22Z"    }  ],  "next_page_token": "string"}

Was this helpful?