> ## Agent Instructions
>
> Base URL: https://api.anysite.io
> Authentication: send the `access-token` header. Do NOT use `Authorization: Bearer`.
> Full endpoint catalog: https://app.anysite.io/docs
# Error Codes

API error codes and troubleshooting guide

## HTTP Status Codes

All Anysite API endpoints return standard HTTP status codes. Below is the complete list of error codes you may encounter.

| Code | Description | Action |
|------|-------------|--------|
| **400** | Invalid input format (e.g., malformed LinkedIn URN, missing required field) | Check your request body and parameter formats |
| **401** | Missing or invalid `access-token` header | Verify your API key at [app.anysite.io](https://app.anysite.io) |
| **403** | No access to the requested resource or account | Check your subscription plan and permissions |
| **404** | Requested entity not found (account, email, job listing, etc.) | Verify the URL, username, or ID you're querying |
| **408** | Request execution timeout exceeded | Increase the `timeout` parameter or simplify your query |
| **412** | Entity unavailable at source (deleted, blocked, or URL not responding) | The target profile/page may have been removed or restricted |
| **422** | Validation error — request body doesn't match expected schema | Check required fields and parameter types |
| **429** | Rate limit exceeded | Wait and retry, or reduce request frequency |
| **500** | Internal server error or data source unavailable | Retry after a short delay; contact support if persistent |

## Error Response Format

All error responses return a JSON body:

```json
{
  "detail": "Error description message"
}
```

For validation errors (422), the response includes field-level details:

```json
{
  "detail": [
    {
      "loc": ["body", "user"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}
```

## Common Scenarios

### 400 — Bad Request
```json
// Invalid LinkedIn URN format
{"detail": "Invalid URN format. Expected: 'urn:li:fsd_profile:ABC123'"}
```

### 404 — Not Found
```json
// User profile doesn't exist
{"detail": "LinkedIn user not found"}
```

### 408 — Timeout
Increase the `timeout` parameter in your request body (default: 300 seconds, max: 1500):
```json
{
  "user": "linkedin.com/in/username",
  "timeout": 600
}
```

### 412 — Precondition Failed
The target entity exists but is not accessible:
- LinkedIn profile is private or deactivated
- Instagram account is restricted
- Web page returns an error

### 429 — Rate Limit
Check your current usage with the token management endpoints:
```bash
curl -H "access-token: YOUR_API_KEY" https://api.anysite.io/token/statistic
```
