> This page is for API, version 2026-01-01 (Stable) (default).
> For other versions, use one of these documentation indexes:
> - 2026-01-01 (Stable) (default): https://docs.deel.wtf/api/stable/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.deel.wtf/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.deel.wtf/_mcp/server.

# Retrieve a request log

GET https://api.letsdeel.com/rest/logs/requests/{request_id}

Returns one request by its x-request-id, together with a plain-language explanation of its outcome (`gateway_message`) and what to do about it (`hint`). Use it when a client reports a failed call: the request id is echoed in every response header and in the error envelope. Requests of other organizations are not visible and answer 404.

 **Token scopes**: `api-logs:read`

 **Beta**: this version requires the `X-Beta: true` request header and its contract may change before it is promoted to stable. It is scheduled to become stable on 2027-01-13.

Reference: https://docs.deel.wtf/api/reference/endpoints/logs/retrieve-request-log-v-2026-10-13

## Authentication

- `Authorization` header (bearer token, required) — ## Authentication The Deel API uses bearer tokens to authenticate requests. All API calls must be made over HTTPS — calls over plain HTTP or without authentication will fail. ```curl curl -X GET 'https://api.deel.training/rest/v2/contracts' \ -H 'Authorization: Bearer YOUR-TOKEN-HERE' ``` [Learn more about authentication](/api/authentication)
- `Authorization` header (bearer token, required) — Standard OAuth2 security scheme based on https://swagger.io/docs/specification/authentication/

## Servers

- `https://api.letsdeel.com/rest` (Production, default)
- `https://api-staging.letsdeel.com/rest` (Demo)

## Request

### Path parameters

- `request_id` (string, required) — The x-request-id of the request

### Headers

- `X-Beta` (enum, required, default: true) — Opts in to the beta version of this endpoint. Must be `true`.
  - Allowed values: `true`

## Response

### 200

The request log with its gateway message

- `data` (LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaData, required) — The recorded request together with a human-readable explanation of its outcome

## Errors

### 400 Bad Request Error

Invalid query parameter, cursor or time window

- `errors` (list of LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaErrorsItems, required) — The errors, at least one
- `request` (LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaRequest, required) — The request the error belongs to

### 401 Unauthorized Error

Missing or invalid access token

- `errors` (list of LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaErrorsItems, required) — The errors, at least one
- `request` (LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaRequest, required) — The request the error belongs to

### 403 Forbidden Error

The token lacks the api-logs:read scope or the user lacks the developer_center.manage permission

- `errors` (list of LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaErrorsItems, required) — The errors, at least one
- `request` (LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaRequest, required) — The request the error belongs to

### 404 Not Found Error

No request with this id is visible to the organization

- `errors` (list of LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaErrorsItems, required) — The errors, at least one
- `request` (LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaRequest, required) — The request the error belongs to

### 429 Too Many Requests Error

Rate limit of 60 requests per minute per organization exceeded

- `errors` (list of LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaErrorsItems, required) — The errors, at least one
- `request` (LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaRequest, required) — The request the error belongs to

### 500 Internal Server Error

Operation failed.

- `request` (ApiErrorRequest, optional)
- `errors` (list of ApiError, optional)

## Types

### LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaData

The recorded request together with a human-readable explanation of its outcome

- `ip` (string, required) — Client IP address the request came from
- `hint` (string, required) — What to do about it
- `path` (string, required) — Request path without the query string
- `error` (LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaDataError, required, nullable) — Gateway-generated error of a failed request; null when the request succeeded or the error came from the service
- `route` (string, required, nullable) — Public route template the request matched; null when no endpoint matched (404)
- `token` (LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaDataToken, required) — The token that made the request, as the gateway saw it at request time
- `method` (string, required) — HTTP method
- `source` (enum, required) — Where the request came in: REST API, SCIM or an MCP tool call
  - Allowed values: `rest`, `scim`, `mcp`
- `status` (integer, required) — HTTP status returned to the caller
- `timestamp` (string, required) — When the response was sent (UTC)
- `request_id` (string, required) — The x-request-id of the request; quote it when contacting support
- `user_agent` (string, required, nullable) — User-Agent header, truncated to 512 characters
- `api_version` (string, required, nullable) — API version the request resolved to
- `duration_ms` (integer, required) — Total time from request start to response end, in milliseconds
- `response_bytes` (integer, required, nullable) — Size of the response body in bytes
- `gateway_message` (string, required) — What the status and gateway error code mean, in plain language
- `upstream_duration_ms` (integer, required, nullable) — Time spent in the service behind the gateway, in milliseconds; null when the gateway answered itself

### LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaErrorsItems

One error

- `code` (string, required) — Machine-readable error code
- `message` (string, required) — Human-readable description

### LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaRequest

The request the error belongs to

- `url` (string, required) — URL of the request
- `method` (string, required) — HTTP method of the request
- `status` (integer, required) — HTTP status returned
- `api_req_id` (string, required) — Request id to quote when contacting support
- `docs` (string, optional) — Link to the documentation
- `source` (string, optional) — API surface that produced the error

### ApiErrorRequest

- `method` (string, optional) — The HTTP method of the failed request
- `url` (string, optional) — The relative URL of the failed request
- `status` (double, optional) — The status code of the response
- `api_req_id` (string, optional) — The request ID of the failed request
- `docs` (string, optional) — A link to the official documentation for the requested endpoint resource
- `source` (string, optional) — The source handler which produced the returned error
- `code` (double, optional) — The code of the source handler which produced the returned error

### ApiError

- `message` (string, optional) — A description of the returned error
- `path` (string, optional) — The JSON path where input validation failed

### LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaDataError

Gateway-generated error of a failed request; null when the request succeeded or the error came from the service

- `code` (string, required, nullable) — Machine-readable gateway error code
- `message` (string, required, nullable) — Human-readable gateway error message

### LogsRequestsRequestIdGetResponsesContentApplicationJsonSchemaDataToken

The token that made the request, as the gateway saw it at request time

- `id` (string, required) — Token id shown in the Developer Center
- `type` (enum, required) — Personal access token or OAuth2 access token
  - Allowed values: `pat`, `oauth2`
- `label` (string, required, nullable) — Token label or OAuth2 client name when the request was made
- `oauth2_client_id` (string, required, nullable) — OAuth2 client the token belongs to; null for personal access tokens

## Examples

**Response**

```json
{
  "data": {
    "ip": "203.0.113.42",
    "hint": "Grant the required scope named in the error message to the token in the Developer Center, or call with a token that has it.",
    "path": "/rest/v2/contracts/3k9d2m",
    "error": {
      "code": "INSUFFICIENT_SCOPES",
      "message": "Missing required scope: contracts:read"
    },
    "route": "/rest/v2/contracts/{contract_id}",
    "token": {
      "id": "2f4d6c8a-1b3e-4f5a-9c7d-8e6f0a1b2c3d",
      "type": "pat",
      "label": "HRIS sync",
      "oauth2_client_id": null
    },
    "method": "GET",
    "source": "rest",
    "status": 200,
    "timestamp": "2026-09-21T16:04:39.001Z",
    "request_id": "5f1c2a8e9b3d4c7a1e2f3a4b",
    "user_agent": "deel-cli/1.4.0",
    "api_version": "2025-01-01",
    "duration_ms": 184,
    "response_bytes": 2048,
    "gateway_message": "The token does not carry a scope this endpoint requires.",
    "upstream_duration_ms": 151
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.letsdeel.com/rest/logs/requests/5f1c2a8e9b3d4c7a1e2f3a4b"

headers = {
    "X-Beta": "true",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.letsdeel.com/rest/logs/requests/5f1c2a8e9b3d4c7a1e2f3a4b';
const options = {method: 'GET', headers: {'X-Beta': 'true', Authorization: 'Bearer <token>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://api.letsdeel.com/rest/logs/requests/5f1c2a8e9b3d4c7a1e2f3a4b"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Beta", "true")
	req.Header.Add("Authorization", "Bearer <token>")

	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://api.letsdeel.com/rest/logs/requests/5f1c2a8e9b3d4c7a1e2f3a4b")

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

request = Net::HTTP::Get.new(url)
request["X-Beta"] = 'true'
request["Authorization"] = 'Bearer <token>'

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.get("https://api.letsdeel.com/rest/logs/requests/5f1c2a8e9b3d4c7a1e2f3a4b")
  .header("X-Beta", "true")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.letsdeel.com/rest/logs/requests/5f1c2a8e9b3d4c7a1e2f3a4b', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Beta' => 'true',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/logs/requests/5f1c2a8e9b3d4c7a1e2f3a4b");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Beta", "true");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Beta": "true",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/logs/requests/5f1c2a8e9b3d4c7a1e2f3a4b")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```