Source: https://support.atomicwork.com/api-reference/access-management/postapi-v1-iga-grants-list

# List grants with filters

POST `https://{tenant}.atomicwork.com/api/v1/iga/grants/list`

Search and list identity grants with advanced filtering.
Supports filtering by user, app, entitlement, status, and date ranges via request body filters.

### Filtering

The request body is an **array of filter objects**. Send an empty array (`[]`) to retrieve all records.

Each filter object has the following fields:

| Field       | Type   | Description                                             |
| ----------- | ------ | ------------------------------------------------------- |
| `attribute` | string | The field to filter on (see Supported attributes below) |
| `operator`  | string | Comparison operator (see Available operators below)     |
| `values`    | array  | One or more `\{ "value": \<scalar> \}` objects          |

**Supported attributes**

| Attribute           | Typical operator | Description                                                                                                                                                                                                                       |
| ------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`            | `IS_ANY_OF`      | Grant status **bucket** (not the raw status). Accepted values: `ACTIVE` (includes GRANTED and EXTENDED grants), `INACTIVE` (includes REVOKED and EXPIRED grants), `REVOKED` (revoked only). See the Status Reference table below. |
| `user`              | `IS_ANY_OF`      | Numeric user ID of the grant recipient (the `id` field from `GET /api/v1/users`). Pass one or more user IDs to filter grants belonging to specific people.                                                                        |
| `app`               | `IS_ANY_OF`      | Application ID — the identity resource app the entitlement belongs to (the `id` field from `GET /api/v1/iga/apps`). Filters grants to entitlements under a specific app.                                                          |
| `entitlement`       | `IS_ANY_OF`      | Entitlement ID — the specific entitlement (group, role, license, etc.) the grant was issued for. Use `GET /api/v1/iga/entitlements` to discover IDs.                                                                              |
| `entitlement_value` | `IS_ANY_OF`      | Entitlement value string — filters by the human-readable entitlement value (e.g. the group name or role name) rather than the numeric ID.                                                                                         |
| `granted_at`        | `IS_BETWEEN`     | Grant creation timestamp. Requires exactly **two** values: `[start, end]` (both inclusive). Accepts ISO 8601 format (`2024-01-01T00:00:00Z`).                                                                                     |
| `expires_at`        | `IS_BETWEEN`     | Grant expiration timestamp. Same format as `granted_at`. Use this to find grants expiring within a specific window.                                                                                                               |
| `last_login_at`     | `IS_BETWEEN`     | Last login timestamp for the grant recipient. Same format as `granted_at`. Useful for identifying unused grants where the user hasn't logged in recently.                                                                         |

**Available operators**

| Operator                             | Meaning                                                   |
| ------------------------------------ | --------------------------------------------------------- |
| `EQUALS`                             | Exact match                                               |
| `NOT_EQUALS`                         | Exclude exact match                                       |
| `IN` / `IS_ANY_OF`                   | Match any value in the list                               |
| `IS_NOT_ANY_OF`                      | Exclude all listed values                                 |
| `IS_BETWEEN`                         | Inclusive range — pass exactly two values: `[start, end]` |
| `IS_ON_OR_BEFORE` / `IS_ON_OR_AFTER` | Date/time boundary comparisons                            |
| `CONTAINS` / `TEXT_CONTAINS`         | Substring or set membership                               |
| `IS_NULL` / `IS_NOT_NULL`            | Null checks — `values` array can be empty                 |
| `STARTS_WITH` / `ENDS_WITH`          | String prefix/suffix match                                |

**Status Reference**

Grants have a raw status and a **status bucket** used for filtering:

| Filter value | Raw statuses included | Description                            |
| ------------ | --------------------- | -------------------------------------- |
| `ACTIVE`     | GRANTED, EXTENDED     | Currently valid grants                 |
| `INACTIVE`   | REVOKED, EXPIRED      | No longer valid grants                 |
| `REVOKED`    | REVOKED               | Only manually or system-revoked grants |

**Grant types** (returned in responses, not used as filter attributes)

| Type          | Description                                                              |
| ------------- | ------------------------------------------------------------------------ |
| `BIRTHRIGHT`  | Automatically assigned based on user attributes (department, role, etc.) |
| `PREAPPROVED` | Pre-approved via an access policy — no approval workflow required        |
| `APPROVED`    | Granted after completing an approval workflow                            |

**Entitlement types** (filter via the entitlements endpoint, not on grants directly)

| Type      | Description                                                          |
| --------- | -------------------------------------------------------------------- |
| `GROUP`   | Identity provider group membership (e.g. Azure AD group, Okta group) |
| `ROLE`    | Application role assignment                                          |
| `LICENSE` | Software license entitlement                                         |
| `REPO`    | Repository access                                                    |
| `OTHER`   | Custom entitlement type                                              |

**Provisioning providers** (shown in grant responses)

| Provider           | Description                                               |
| ------------------ | --------------------------------------------------------- |
| `OKTA`             | Okta identity provider                                    |
| `AZURE_AD`         | Microsoft Entra ID (Azure AD)                             |
| `JUMPCLOUD`        | JumpCloud directory                                       |
| `GOOGLE_WORKSPACE` | Google Workspace                                          |
| `MS_INTUNE`        | Microsoft Intune device management                        |
| `MANUAL`           | Manual provisioning (service request created for IT team) |

**Example**

```json
[
  {
    "attribute": "status",
    "operator": "IS_ANY_OF",
    "values": [
      {
        "value": "ACTIVE"
      }
    ]
  },
  {
    "attribute": "app",
    "operator": "IS_ANY_OF",
    "values": [
      {
        "value": 42
      }
    ]
  },
  {
    "attribute": "granted_at",
    "operator": "IS_BETWEEN",
    "values": [
      {
        "value": "2024-01-01T00:00:00Z"
      },
      {
        "value": "2024-12-31T23:59:59Z"
      }
    ]
  },
  {
    "attribute": "user",
    "operator": "IS_ANY_OF",
    "values": [
      {
        "value": 123
      },
      {
        "value": 456
      }
    ]
  }
]
```

## Authorization

#### X-Api-Key (header, string, required)

API key authentication.

## Headers

#### X-Workspace-Id (header, string)

## Query Parameters

#### search\_key (query, string)

#### sort\_order (query, enum (string)) — allowed: CREATED\_AT\_ASC, CREATED\_AT\_DESC, UPDATED\_AT\_ASC, UPDATED\_AT\_DESC, NAME\_ASC, NAME\_DESC, PUBLISHED\_DESC, UNPUBLISHED\_DESC, EXPIRES\_AT\_ASC, EXPIRES\_AT\_DESC, GRANTED\_AT\_ASC, GRANTED\_AT\_DESC

#### policy\_id (query, string)

#### app\_id (query, integer)

#### page (query, integer)

#### per\_page (query, integer)

#### next\_page\_token (query, string)

Token from previous response to fetch the next page. When provided, takes priority over page and per\_page parameters.

#### ids (query, string)

Comma-separated list of grant IDs to filter by. When provided, returns only grants matching these IDs.

## Response

#### 200

Successful response

#### Request

```bash cURL
curl -X POST 'https://{tenant}.atomicwork.com/api/v1/iga/grants/list' \
  -H 'X-Api-Key: <api-key>' \
  -H 'Content-Type: application/json' \
  -d '[{"attribute": "string", "operator": "EQUALS", "values": [{"value": "\u2026", "nested_filter": "\u2026"}]}]'
```

```javascript JavaScript
const res = await fetch('https://{tenant}.atomicwork.com/api/v1/iga/grants/list', {
  method: 'POST',
  headers: {
    'X-Api-Key': '<api-key>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify([{"attribute": "string", "operator": "EQUALS", "values": [{"value": "\u2026", "nested_filter": "\u2026"}]}]),
});
const data = await res.json();
```

```python Python
import requests

res = requests.post(
    'https://{tenant}.atomicwork.com/api/v1/iga/grants/list',
    headers={'X-Api-Key': '<api-key>'},
    json=[{"attribute": "string", "operator": "EQUALS", "values": [{"value": "\u2026", "nested_filter": "\u2026"}]}]
)
data = res.json()
```
