> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deepidv.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Session Status

> Manually update a session's status to VERIFIED or REJECTED

```
PATCH /v1/sessions/{id}/update-status
```

Manually updates the status of a verification session to either `VERIFIED` or `REJECTED`.

## Request

### Headers

| Header      | Required | Description  |
| ----------- | -------- | ------------ |
| `x-api-key` | Yes      | Your API key |

### Path parameters

| Parameter | Type   | Required | Description                                                    |
| --------- | ------ | -------- | -------------------------------------------------------------- |
| `id`      | string | Yes      | The session ID (returned as `id` when the session was created) |

### Body parameters

| Parameter    | Type   | Required | Description                                             |
| ------------ | ------ | -------- | ------------------------------------------------------- |
| `new_status` | string | Yes      | The new status to set. Must be `VERIFIED` or `REJECTED` |

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH https://api.deepidv.com/v1/sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/update-status \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"new_status": "VERIFIED"}'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.deepidv.com/v1/sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/update-status",
    {
      method: "PATCH",
      headers: {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ new_status: "VERIFIED" }),
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.patch(
      "https://api.deepidv.com/v1/sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/update-status",
      headers={"x-api-key": "YOUR_API_KEY"},
      json={"new_status": "VERIFIED"},
  )
  ```
</CodeGroup>

## Response

### 200 — Success

### Response fields

| Field            | Type   | Description                                                                                                                                                                                               |
| ---------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `session_record` | object | The updated session object (same shape as the `session_record` in the [Retrieve Session](/api-reference/sessions/retrieve-session) response). Does not include `resource_links`, `user`, or `sender_user` |

### Error responses

| Status                  | Description                                                                |
| ----------------------- | -------------------------------------------------------------------------- |
| `400 Bad Request`       | Invalid session ID or `new_status` value. Must be `VERIFIED` or `REJECTED` |
| `401 Unauthorized`      | Missing or invalid API key                                                 |
| `403 Forbidden`         | Session belongs to a different organization                                |
| `404 Not Found`         | Session ID does not exist                                                  |
| `429 Too Many Requests` | Rate limit exceeded                                                        |

<ResponseExample>
  ```json 200 theme={null}
  {
    "session_record": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "organization_id": "org_abc123",
      "user_id": "usr_def456",
      "sender_user_id": "usr_ghi789",
      "external_id": "user-12345",
      "status": "VERIFIED",
      "type": "verification",
      "session_progress": "COMPLETED",
      "created_at": "2025-01-15T10:30:00.000Z",
      "updated_at": "2025-01-15T11:00:00.000Z"
    }
  }
  ```
</ResponseExample>
