# Update access request status

URL: /en/docs/api/v1/access-requests/id/patch
Last Updated: 2026-07-30T21:15:44.986Z

## Description
No description available.

## Available Actions
- Execute PATCH request
- View request parameters
- View response schema
- Get code examples
- Navigate to related topics
- View step-by-step instructions
- Get best practices

## Content
### PATCH /api/v1/access-requests/{id}

**Update access request status**

Update the review status of an access request. 

When changing status to "approved":
- A magic link email is automatically sent to the contact
- The magic link expires after the configured expiry period (default 24 hours)
- You can optionally update the contact's review status in the same request

When changing status to "rejected":
- By default, no email is sent to the contact (send_rejection_email defaults to false)
- You can optionally send a rejection notification email by setting send_rejection_email to true
- The rejection email will include the list of documents that were requested

The contact must belong to an account within your tenant

**Authentication:** Bearer token (`Authorization: Bearer <token>`)

**Path parameters:**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | Yes | Access request ID |

**Request body** (`application/json`) - required:

- `review_status` (enum: to_review | in_review | approved | rejected, required): New review status for the access request
- `contact_review_status` (enum: to_review | in_review | approved | rejected): Optional - update the contact's review status at the same time
- `send_rejection_email` (boolean): Optional - when rejecting, send notification email to the contact (defaults to false)

Example (Approve access request):

```json
{
  "review_status": "approved"
}
```

Example (Approve access request and contact):

```json
{
  "review_status": "approved",
  "contact_review_status": "approved"
}
```

Example (Reject without notification (default)):

```json
{
  "review_status": "rejected"
}
```

Example (Reject with email notification):

```json
{
  "review_status": "rejected",
  "send_rejection_email": true
}
```

**Responses:**

- `200` - Access request updated successfully
  - `success` (boolean)
  - `data` (object)
    - `access_request` (object)
      - `id` (string)
      - `review_status` (string)
      - `date_updated` (string (date-time))
  - `warning` (string): Warning message if email failed to send (magic link or rejection)

  Example (Successful approval with magic link sent):
  
  ```json
  {
  "success": true,
  "data": {
    "access_request": {
      "id": "req-123",
      "review_status": "approved",
      "date_updated": "2025-01-15T14:30:00Z"
    }
  }
}
  ```

  Example (Success but email failed):
  
  ```json
  {
  "success": true,
  "data": {
    "access_request": {
      "id": "req-123",
      "review_status": "approved",
      "date_updated": "2025-01-15T14:30:00Z"
    }
  },
  "warning": "Status updated successfully, but magic link email could not be sent."
}
  ```

  Example (Successful rejection with email sent):
  
  ```json
  {
  "success": true,
  "data": {
    "access_request": {
      "id": "req-123",
      "review_status": "rejected",
      "date_updated": "2025-01-15T14:30:00Z"
    }
  }
}
  ```
- `400` - Bad Request - Access Request ID is required
  - `error` (string)
- `401` - Unauthorized - invalid or missing authentication token
- `403` - Forbidden - Access request does not belong to your organization
  - `error` (string)
- `500` - Internal server error

**Code samples:**

cURL - Approve request:

```bash
curl -X PATCH "https://app.orbiqhq.com/api/v1/access-requests/req-123" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "review_status": "approved"
  }'

```

cURL - Approve with contact:

```bash
curl -X PATCH "https://app.orbiqhq.com/api/v1/access-requests/req-123" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "review_status": "approved",
    "contact_review_status": "approved"
  }'

```

cURL - Reject request silently (default):

```bash
curl -X PATCH "https://app.orbiqhq.com/api/v1/access-requests/req-123" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "review_status": "rejected"
  }'

```

cURL - Reject with email notification:

```bash
curl -X PATCH "https://app.orbiqhq.com/api/v1/access-requests/req-123" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "review_status": "rejected",
    "send_rejection_email": true
  }'

```

