Source: https://atomicwork-preview.docs-staging.pageloop.ai/api-reference/accessmanagement/putapi-v-1-iga-grants-grant-id

# Update a grant

PUT `https://{tenant}.atomicwork.com/api/v1/iga/grants/{grant_id}`

Update an identity grant's metadata. Use this to change the associated policy, update the grantor, or adjust grant timestamps.

**Updatable fields:**

- `status` — transition the grant to a new status
- `policy_id` or `policy_key` — reassign the grant to a different access policy
- `granted_by` — update the grantor identifier
- `granted_at` — correct the grant timestamp

To revoke a grant, use the dedicated `POST /iga/grants/\{grant_id\}/revoke` endpoint instead — it handles deprovisioning workflows.

## Authorization

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

## Headers

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

## Path Parameters

#### grant\_id (path, string, required)

## Body

#### status (body, enum (string))

#### policy\_id (body, integer)

Change the policy associated with the grant

#### policy\_key (body, string)

Change the policy by key (alternative to policy\_id)

#### granted\_by (body, integer)

User ID who authorized this grant

#### granted\_at (body, string)

When the grant was authorized

## Response

#### 200

Successful response

#### Request

```bash cURL
curl -X PUT 'https://{tenant}.atomicwork.com/api/v1/iga/grants/{grant_id}' \
  -H 'X-Api-Key: <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{"status": "GRANTED", "policy_id": 0, "policy_key": "string", "granted_by": 0, "granted_at": "date-time"}'
```

```javascript JavaScript
const res = await fetch('https://{tenant}.atomicwork.com/api/v1/iga/grants/{grant_id}', {
  method: 'PUT',
  headers: {
    'X-Api-Key': '<api-key>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"status": "GRANTED", "policy_id": 0, "policy_key": "string", "granted_by": 0, "granted_at": "date-time"}),
});
const data = await res.json();
```

```python Python
import requests

res = requests.put(
    'https://{tenant}.atomicwork.com/api/v1/iga/grants/{grant_id}',
    headers={'X-Api-Key': '<api-key>'},
    json={"status": "GRANTED", "policy_id": 0, "policy_key": "string", "granted_by": 0, "granted_at": "date-time"}
)
data = res.json()
```
