---
title: "Grant a list of organization access of a user for a application."
method: PUT
path: "/api/applications/{id}/users/{userId}/consent-organizations"
tags: ["Applications"]
---

# Grant a list of organization access of a user for a application.

`PUT /api/applications/{id}/users/{userId}/consent-organizations`

Grant a list of organization access of a user for a application by application id and user id. <br/> The user must be a member of all the organizations. <br/> Only third-party application needs to be granted access to organizations, all the other applications can request for all the organizations' access by default.

## Path parameters

- `id` string, required
- `userId` string, required

## Request body

- object
  - `organizationIds` string[], required — A list of organization ids to be granted. <br/> All the existing organizations' access will be revoked if not in the list. <br/> If the list is empty, all the organizations' access will be revoked.

## Response `204`

All the request organizations's access are granted to the user for the application.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — The application or user is not found.
- `422` — The user is not a member of one of the organizations, or the application is not a third-party application.

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/versions/a163dc77d842/schema)
