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

# Query customer logs

GET https://api.runtype.com/v1/logs

Query persisted customer logs with filtering, pagination, and search. When `data.live` is present the page came from the span store: one entry is one execution seam, so sub-seam rows (step skips, sources, context notices, artifacts, state snapshots, custom events) are not listed, a start/complete pair is one row carrying a duration, runs still in progress appear once they finish, and `search` matches a span's message, name, operation, tool name or error class. Otherwise each entry is one event. Requests naming `audit` or `schedule`, and an audit-entitled unfiltered read, are always served from the event tier.

Reference: https://docs.runtype.com/api-reference/runtype-api/logs/query-customer-logs

## Authentication

- `Authorization` header (bearer token, required) — API key or Clerk session token

## Servers

- `https://api.runtype.com` (Production, default)
- `https://api.runtype-staging.com` (Staging)

## Request

### Query parameters

- `from` (string, optional) — Start timestamp (ISO 8601). Defaults to 24 hours ago.
- `to` (string, optional) — End timestamp (ISO 8601). Defaults to now.
- `startTime` (string, optional) — Alias for from. Ignored when from is also given.
- `endTime` (string, optional) — Alias for to. Ignored when to is also given.
- `level` (string, optional) — Comma-separated log levels (debug,info,warn,error). An unknown value is rejected with 400.
- `category` (string, optional) — Comma-separated categories (execution,agent,tool,model,system,error,schedule,batch,audit). An unknown value is rejected with 400.
- `flowId` (string, optional) — Filter by flow ID
- `agentId` (string, optional) — Filter by agent ID
- `executionId` (string, optional) — Filter by runtime execution_id / executionSessionId (for example exec_... or otel-...), not the aex_... agent-execution row ID
- `surfaceId` (string, optional) — Filter by surface ID
- `conversationId` (string, optional) — Filter by conversation ID
- `search` (string, optional) — Case-insensitive substring search over a span's message, name, operation, tool name or error class; a live-tier row matches on its message.
- `status` (string, optional) — Comma-separated statuses (running,completed,failed,queued,cancelled,unknown). An unknown value is rejected with 400. A row is unknown while its activity has not finished, else failed at level error and completed otherwise; running, queued and cancelled match no row today.
- `type` (string, optional) — Comma-separated entry types (flow,step,tool,batch,system,agent,model,schedule,audit). An unknown value is rejected with 400. Matches the type each row is rendered with, so step selects step spans only and flow selects flow runs without their steps. Combined with category by AND.
- `limit` (string, optional) — Max results per page (default 500, max 1000)
- `cursor` (string, optional) — Pagination cursor
- `order` (string, optional) — Sort order: asc or desc

## Response

### 200

Log entries returned

- `data` (V1LogsGetResponsesContentApplicationJsonSchemaData, required)
- `success` (boolean, required)
- `window` (V1LogsGetResponsesContentApplicationJsonSchemaWindow, required) — The time window the query resolved to, after defaults and from/to aliases.

## Errors

### 400 Bad Request Error

Invalid request

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 401 Unauthorized Error

Unauthorized

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 402 Payment Required Error

Audit trail not available on the current plan (category=audit requested)

- `code` (string, required)
- `error` (string, required)
- `message` (string, required)

### 403 Forbidden Error

API key lacks a read scope (FLOWS:READ, AGENTS:READ or ANALYTICS:READ)

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 500 Internal Server Error

Internal server error

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 503 Service Unavailable Error

Log store temporarily unavailable; no entries or counts could be read

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of ErrorDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

## Types

### V1LogsGetResponsesContentApplicationJsonSchemaData

- `entries` (list of V1LogsGetResponsesContentApplicationJsonSchemaDataEntriesItems, required)
- `pagination` (V1LogsGetResponsesContentApplicationJsonSchemaDataPagination, required)
- `degraded` (boolean, optional) — True when the live overlay or the audit plane could not be read, so entries from that source are missing. Absent on healthy responses.
- `live` (V1LogsGetResponsesContentApplicationJsonSchemaDataLive, optional) — Present only when the page was served from the span store. Runs still in progress appear once they finish; the minutes above the cut-line come from the live tier when it answers in time. Absent otherwise.

### V1LogsGetResponsesContentApplicationJsonSchemaWindow

The time window the query resolved to, after defaults and from/to aliases.

- `from` (string, required) — Resolved start timestamp the query actually used
- `to` (string, required) — Resolved end timestamp the query actually used

### ErrorDetailsItems

- `message` (string, required)
- `code` (string, optional) — Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM).
- `path` (string, optional) — Dotted JSON path to the offending field.
- `suggestion` (string, optional) — Actionable hint (allowed values, accepted range, …).

### V1LogsGetResponsesContentApplicationJsonSchemaDataEntriesItems

### V1LogsGetResponsesContentApplicationJsonSchemaDataPagination

- `cursor` (string, required, nullable)
- `hasMore` (boolean, required)
- `cursorReset` (boolean, optional) — True when the supplied cursor could not be honoured and the read restarted at page one. A paging client must stop rather than follow the fresh cursor. Absent otherwise.

### V1LogsGetResponsesContentApplicationJsonSchemaDataLive

Present only when the page was served from the span store. Runs still in progress appear once they finish; the minutes above the cut-line come from the live tier when it answers in time. Absent otherwise.

- `cutline` (string, required) — Entries at or below this instant came from the span store; newer ones from the live tier.
- `served` (boolean, required)
- `reason` (enum, optional)
  - Allowed values: `hot_tier_failed`, `outside_window`

## Examples

**Response**

```json
{
  "data": {
    "entries": [
      {}
    ],
    "pagination": {
      "cursor": "string",
      "hasMore": true,
      "cursorReset": true
    },
    "degraded": true,
    "live": {
      "cutline": "string",
      "served": true,
      "reason": "hot_tier_failed"
    }
  },
  "success": true,
  "window": {
    "from": "string",
    "to": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.runtype.com/v1/logs"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript
const url = 'https://api.runtype.com/v1/logs';
const options = {method: 'GET', headers: {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.runtype.com/v1/logs"

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

	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.runtype.com/v1/logs")

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

request = Net::HTTP::Get.new(url)
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.runtype.com/v1/logs")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.runtype.com/v1/logs', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.runtype.com/v1/logs");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.runtype.com/v1/logs")! 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()
```