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

# Create a grant for a user

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

Create an identity grant directly without going through the IGA workflow.
Requires user\_id and entitlement\_id. Optionally specify policy, granted\_by, and granted\_at.
The grant method is automatically derived from the entitlement's provisioning config.

## Authorization

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

API key authentication.

## Headers

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

## Body

#### user\_id (body, integer, required)

The ID of the user who will receive the grant

#### entitlement\_id (body, integer, required)

The ID of the entitlement to grant

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

Optional policy ID to associate with the grant

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

Optional policy key (alternative to policy\_id)

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

Optional user ID of who authorized this grant. Defaults to the API key owner.

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

Optional timestamp of when the grant was authorized. Defaults to current time.

## Response

#### 200

Successful response

#### Request

```bash cURL
curl -X POST 'https://{tenant}.atomicwork.com/api/v1/iga/grants' \
  -H 'X-Api-Key: <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{"user_id": 0, "entitlement_id": 0, "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', {
  method: 'POST',
  headers: {
    'X-Api-Key': '<api-key>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"user_id": 0, "entitlement_id": 0, "policy_id": 0, "policy_key": "string", "granted_by": 0, "granted_at": "date-time"}),
});
const data = await res.json();
```

```python Python
import requests

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