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

# Get Request

> Retrieve detailed information about a specific request including status, response data, and broadcast results

Get comprehensive information about a specific request. This endpoint is useful for polling request status and retrieving the human reviewer's response once completed.

## Authentication

**Authorization** `string` *required*

Your API key for authentication

## Path Parameters

**id** `string` *required*

The unique identifier of the request

## Response

**error** `boolean`

Whether an error occurred

**msg** `string`

Success message

**data** `object`

**data**

**request** `object`

The complete request object

**request**

**id** `string`

Unique identifier for the request

**loop\_id** `string`

ID of the loop this request belongs to

**creator\_id** `string`

ID of the user who created the request

**api\_key\_id** `string`

ID of the API key used to create the request

**processing\_type** `string`

Processing urgency type (`time-sensitive`, `deferred`)

**type** `string`

Content type (`markdown`, `image`)

**priority** `string`

Priority level (`low`, `medium`, `high`, `critical`)

**request\_text** `string`

The main content of the request

**image\_url** `string`

URL of the image to review (if applicable)

**context** `object`

Additional context data

**platform** `string`

Platform that created the request

**platform\_version** `string`

Version of the platform used

**response\_type** `string`

Type of response expected

**response\_config** `object`

Configuration for the response type

**default\_response** `object`

Default response if timeout occurs

**timeout\_at** `string`

ISO timestamp when the request times out

**callback\_url** `string`

URL to call when request is completed

**broadcasted\_to** `array`

List of users who received the request notification

**broadcasted\_at** `string`

ISO timestamp when the request was broadcasted

**status** `string`

Current status (`pending`, `completed`, `timeout`, `cancelled`)

**response\_by** `string`

ID of the user who responded (if completed)

**response\_at** `string`

ISO timestamp when the response was submitted

**response\_data** `object`

The actual response data from the reviewer

**response\_time\_seconds** `number`

Time taken to respond in seconds

**created\_at** `string`

ISO timestamp when the request was created

**updated\_at** `string`

ISO timestamp when the request was last updated

```bash cURL theme={null}
curl -X GET https://api.hitl.sh/v1/api/requests/65f1234567890abcdef12348 \
  -H "Authorization: Bearer your_api_key_here"
```

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

url = "https://api.hitl.sh/v1/api/requests/65f1234567890abcdef12348"
headers = {
    "Authorization": "Bearer your_api_key_here"
}

response = requests.get(url, headers=headers)
print(response.json())
```

```javascript Node.js theme={null}
const axios = require('axios');

const response = await axios.get(
  'https://api.hitl.sh/v1/api/requests/65f1234567890abcdef12348',
  {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  }
);

console.log(response.data);
```

```json Pending Request theme={null}
{
  "error": false,
  "msg": "Request retrieved successfully",
  "data": {
    "request": {
      "id": "65f1234567890abcdef12348",
      "loop_id": "65f1234567890abcdef12345",
      "creator_id": "65f1234567890abcdef12346",
      "api_key_id": "65f1234567890abcdef12349",
      "processing_type": "time-sensitive",
      "type": "markdown",
      "priority": "high",
      "request_text": "Please review this user-generated content for community guidelines compliance.",
      "image_url": null,
      "context": {
        "user_id": "user123",
        "post_id": "post456",
        "automated_flags": ["potential_spam"]
      },
      "platform": "api",
      "platform_version": "1.0.0",
      "response_type": "single_select",
      "response_config": {
        "options": ["Approve", "Reject", "Needs Changes"]
      },
      "default_response": "Approve",
      "timeout_at": "2024-03-15T11:30:00Z",
      "callback_url": "https://example.com/webhook/response",
      "broadcasted_to": [
        {
          "user_id": "65f1234567890abcdef12350",
          "email": "reviewer1@example.com",
          "role": "member",
          "notification_sent": true,
          "notification_error": null
        },
        {
          "user_id": "65f1234567890abcdef12351",
          "email": "reviewer2@example.com", 
          "role": "member",
          "notification_sent": true,
          "notification_error": null
        }
      ],
      "broadcasted_at": "2024-03-15T10:30:00Z",
      "status": "pending",
      "response_by": null,
      "response_at": null,
      "response_data": null,
      "response_time_seconds": null,
      "created_at": "2024-03-15T10:30:00Z",
      "updated_at": "2024-03-15T10:30:00Z"
    }
  }
}
```

```json Completed Request theme={null}
{
  "error": false,
  "msg": "Request retrieved successfully",
  "data": {
    "request": {
      "id": "65f1234567890abcdef12348",
      "loop_id": "65f1234567890abcdef12345",
      "creator_id": "65f1234567890abcdef12346",
      "api_key_id": "65f1234567890abcdef12349",
      "processing_type": "time-sensitive",
      "type": "markdown",
      "priority": "high",
      "request_text": "Please review this user-generated content for community guidelines compliance.",
      "image_url": null,
      "context": {
        "user_id": "user123",
        "post_id": "post456",
        "automated_flags": ["potential_spam"]
      },
      "platform": "api",
      "platform_version": "1.0.0",
      "response_type": "single_select",
      "response_config": {
        "options": ["Approve", "Reject", "Needs Changes"]
      },
      "default_response": "Approve",
      "timeout_at": "2024-03-15T11:30:00Z",
      "callback_url": "https://example.com/webhook/response",
      "broadcasted_to": [
        {
          "user_id": "65f1234567890abcdef12350",
          "email": "reviewer1@example.com",
          "role": "member",
          "notification_sent": true,
          "notification_error": null
        }
      ],
      "broadcasted_at": "2024-03-15T10:30:00Z",
      "status": "completed",
      "response_by": "65f1234567890abcdef12350",
      "response_at": "2024-03-15T10:45:00Z",
      "response_data": "Approve",
      "response_time_seconds": 900.5,
      "created_at": "2024-03-15T10:30:00Z",
      "updated_at": "2024-03-15T10:45:00Z"
    }
  }
}
```

## Request Status Types

> [card] Pending
>
> Request is waiting for a reviewer response. No response yet.

> [card] Completed
>
> Reviewer has submitted their response. Check `response_data` field.

> [card] Cancelled
>
> Request was cancelled before completion.

> [card] Timeout
>
> Request timed out. `default_response` was used as the final response.

## Polling Strategy

### Basic Polling

Poll every 30 seconds for time-sensitive requests:

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

def poll_request_status(request_id, api_key, max_attempts=120):
    """Poll request status for up to 1 hour (120 * 30 seconds)"""
    url = f"https://api.hitl.sh/v1/api/requests/{request_id}"
    headers = {"Authorization": f"Bearer {api_key}"}
    
    for attempt in range(max_attempts):
        response = requests.get(url, headers=headers)
        data = response.json()
        
        if data["data"]["request"]["status"] in ["completed", "cancelled", "timeout"]:
            return data["data"]["request"]
        
        time.sleep(30)  # Wait 30 seconds before next poll
    
    return None  # Timeout reached
```

### Exponential Backoff

More efficient polling with increasing intervals:

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

def poll_with_backoff(request_id, api_key):
    """Poll with exponential backoff"""
    url = f"https://api.hitl.sh/v1/api/requests/{request_id}"
    headers = {"Authorization": f"Bearer {api_key}"}
    
    intervals = [5, 10, 30, 60, 120, 300]  # seconds
    
    for interval in intervals:
        response = requests.get(url, headers=headers)
        data = response.json()
        
        status = data["data"]["request"]["status"]
        if status in ["completed", "cancelled", "timeout"]:
            return data["data"]["request"]
        
        time.sleep(interval)
    
    return None
```

## Response Data Examples

### Single Select Response

```json theme={null}
{
  "response_data": "Approve"
}
```

### Multi Select Response

```json theme={null}
{
  "response_data": ["Policy Violation", "Spam"]
}
```

### Rating Response

```json theme={null}
{
  "response_data": 4
}
```

### Text Response

```json theme={null}
{
  "response_data": "The content looks good but could benefit from better formatting."
}
```

### Boolean Response

```json theme={null}
{
  "response_data": true
}
```

## Next Steps

> [card] [Add Feedback](https://docs.hitl.sh/api-reference/requests/add-feedback.md)
>
> Provide feedback on completed requests to improve reviewer performance.

> [card] [Cancel Request](https://docs.hitl.sh/api-reference/requests/cancel-request.md)
>
> Cancel a pending request if it's no longer needed.

> [card] [Set Up Webhooks](https://docs.hitl.sh/api-reference/webhooks.md)
>
> Get real-time notifications instead of polling for status updates.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.