> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer-test.atomicwork.com/llms.txt.
> For full documentation content, see https://developer-test.atomicwork.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer-test.atomicwork.com/_mcp/server.

# Update a grant

PUT https://{tenant}.atomicwork.com/api/v1/iga/grants/{grant_id}
Content-Type: application/json

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.


Reference: https://developer-test.atomicwork.com/atomicwork-public-api/access-management/putapi-v-1-iga-grants-grant-id

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/iga/grants/{grant_id}:
    put:
      operationId: putapi-v-1-iga-grants-grant-id
      summary: Update a grant
      description: >
        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.
      tags:
        - subpackage_accessManagement
      parameters:
        - name: grant_id
          in: path
          description: ''
          required: true
          schema:
            type: string
        - name: X-Api-Key
          in: header
          required: true
          schema:
            type: string
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Access
                  Management_putapi_v1_iga_grants__grant_id_Response_200
      requestBody:
        description: Request body for updating a grant via the public API
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  $ref: >-
                    #/components/schemas/ApiV1IgaGrantsGrantIdPutRequestBodyContentApplicationJsonSchemaStatus
                policy_id:
                  type: integer
                  format: int64
                  description: Change the policy associated with the grant
                policy_key:
                  type: string
                  description: Change the policy by key (alternative to policy_id)
                granted_by:
                  type: integer
                  format: int64
                  description: User ID who authorized this grant
                granted_at:
                  type: string
                  format: date-time
                  description: When the grant was authorized
servers:
  - url: https://{tenant}.atomicwork.com
components:
  schemas:
    ApiV1IgaGrantsGrantIdPutRequestBodyContentApplicationJsonSchemaStatus:
      type: string
      enum:
        - GRANTED
        - EXPIRED
        - EXTENDED
        - REVOKED
      title: ApiV1IgaGrantsGrantIdPutRequestBodyContentApplicationJsonSchemaStatus
    Access Management_putapi_v1_iga_grants__grant_id_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Access Management_putapi_v1_iga_grants__grant_id_Response_200
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

```

## SDK Code Examples

```python
import requests

url = "https://{tenant}.atomicwork.com/api/v1/iga/grants/grant_id"

payload = {
    "status": "EXTENDED",
    "policy_id": 4521,
    "policy_key": "enterprise_admin_access",
    "granted_by": 98765,
    "granted_at": "2024-04-10T15:45:00Z"
}
headers = {
    "X-Workspace-Id": "{{workspace_id}}",
    "X-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{tenant}.atomicwork.com/api/v1/iga/grants/grant_id';
const options = {
  method: 'PUT',
  headers: {
    'X-Workspace-Id': '{{workspace_id}}',
    'X-Api-Key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"status":"EXTENDED","policy_id":4521,"policy_key":"enterprise_admin_access","granted_by":98765,"granted_at":"2024-04-10T15:45:00Z"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://{tenant}.atomicwork.com/api/v1/iga/grants/grant_id"

	payload := strings.NewReader("{\n  \"status\": \"EXTENDED\",\n  \"policy_id\": 4521,\n  \"policy_key\": \"enterprise_admin_access\",\n  \"granted_by\": 98765,\n  \"granted_at\": \"2024-04-10T15:45:00Z\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("X-Workspace-Id", "{{workspace_id}}")
	req.Header.Add("X-Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://{tenant}.atomicwork.com/api/v1/iga/grants/grant_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-Workspace-Id"] = '{{workspace_id}}'
request["X-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"status\": \"EXTENDED\",\n  \"policy_id\": 4521,\n  \"policy_key\": \"enterprise_admin_access\",\n  \"granted_by\": 98765,\n  \"granted_at\": \"2024-04-10T15:45:00Z\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://{tenant}.atomicwork.com/api/v1/iga/grants/grant_id")
  .header("X-Workspace-Id", "{{workspace_id}}")
  .header("X-Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"EXTENDED\",\n  \"policy_id\": 4521,\n  \"policy_key\": \"enterprise_admin_access\",\n  \"granted_by\": 98765,\n  \"granted_at\": \"2024-04-10T15:45:00Z\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://{tenant}.atomicwork.com/api/v1/iga/grants/grant_id', [
  'body' => '{
  "status": "EXTENDED",
  "policy_id": 4521,
  "policy_key": "enterprise_admin_access",
  "granted_by": 98765,
  "granted_at": "2024-04-10T15:45:00Z"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Api-Key' => '<apiKey>',
    'X-Workspace-Id' => '{{workspace_id}}',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://{tenant}.atomicwork.com/api/v1/iga/grants/grant_id");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-Workspace-Id", "{{workspace_id}}");
request.AddHeader("X-Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": \"EXTENDED\",\n  \"policy_id\": 4521,\n  \"policy_key\": \"enterprise_admin_access\",\n  \"granted_by\": 98765,\n  \"granted_at\": \"2024-04-10T15:45:00Z\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Workspace-Id": "{{workspace_id}}",
  "X-Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "status": "EXTENDED",
  "policy_id": 4521,
  "policy_key": "enterprise_admin_access",
  "granted_by": 98765,
  "granted_at": "2024-04-10T15:45:00Z"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://{tenant}.atomicwork.com/api/v1/iga/grants/grant_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```