---
title: "Get temporary permission grants"
method: GET
path: "/v1/{organization}/role/temporary_permission_grants/"
tags: ["Role"]
---

# Get temporary permission grants

`GET /v1/{organization}/role/temporary_permission_grants/`

Retrieve the temporary permission grants that match the given filters.

#### Permissions
This endpoint may be impacted by the following permissions:
* Only temporary permission grants that the authenticated user has `Role:GetTemporaryPermissionGrant` permission for will be returned.

## Path parameters

- `organization` string, required

## Query parameters

- `id` string[] — The IDs of the temporary permission grants to retrieve.
- `user_id` string[] — The user IDs of the temporary permission grants to retrieve.
- `permission_grant_name` string, nullable — The permission name of the grants.
- `is_expired` boolean, nullable — Whether to only return expired or unexpired temporary permission grants.
- `limit` integer — The maximum number of temporary permission grants to return.
- `continuation_token` integer — The continuation token to use to retrieve the next set of temporary permission grants.
- `creator` string[] — The creators of the temporary permission grants.
- `tag` string[] — The tags of the temporary permission grants. Must be specified using the syntax `key:value`, which means to match all sets with the given `key` and `value` pair among its tags. If `value` is `*`, it means the `value` does not matter. If `value` is empty, it matches against when the value is `None`.
- `sort_by` string[] — The fields to sort the sets by. Supported fields are `user_id`, `expires_at`, and `permission_grant.permission_name`. Specify a `+` before the field name to indicate ascending sorting and `-` for descending sorting. Multiple fields can be specified to break ties.

## Headers

- `x-mongo-cluster-name` string, nullable — The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
- `Sec-WebSocket-Protocol` string[]

## Response `200`

Succeeded.

- SrcAppEndpointsRoleGetTemporaryPermissionGrantsResponse
  - `temporary_permission_grants` TemporaryPermissionGrant[], required — The retrieved temporary permission grants.
    - `_id` string, required — The ID of the document.
    - `org_id` string, required — The ID of the organization.
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `user_id` string, required — The ID of the user that this grant applies to.
    - `expires_at` string, date-time, required — The time at which this temporary permission grant expires.
    - `permission_grant` PermissionGrantOutput, required
      - `permission_name` string, required — The name of the permission.
      - `conditions` object, required — A dictionary of attribute name to condition that must be met for this grant to be applicable.
    - `justification` string, required — The reason for offering this permission grant.
    - `creator` AmigoLibMongoCollectionsTemporaryPermissionGrantTemporaryPermissionGrantUserInfo, required
      - `org_id` string, required
      - `user_id` string, required
    - `tags` object, required — The tags of the permission grant.
  - `has_more` boolean, required — Whether there are more temporary permission grants to retrieve.
  - `continuation_token` integer, nullable, required — The continuation token to use to retrieve the next set of temporary permission grants.

## Other responses

- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — Specified organization is not found.
- `422` — Invalid request path parameter or request query parameter failed validation.
- `429` — The user has exceeded the rate limit of 100 requests per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

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