# Logs

Read, download, or stream the logs of a job or a run.

## GET /v1/jobs/{job_id}/logs

Get job logs

```bash
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/jobs/{job_id}/logs
```

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| job_id | path | string | Required | format: uuid |
| stage | query | string or null | Optional |  |
| batch | query | integer or null | Optional |  |
| pod | query | string or null | Optional |  |

Returns 200 or 422.

### 200 response (text/plain)

### 200 response fields and schema

```json
{
  "type": "string"
}
```

## GET /v1/jobs/{job_id}/logs/download

Download job logs

```bash
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/jobs/{job_id}/logs/download
```

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| job_id | path | string | Required | format: uuid |
| stage | query | string or null | Optional |  |
| batch | query | integer or null | Optional |  |
| pod | query | string or null | Optional |  |

Returns 200 or 422.

### 200 response (text/plain)

### 200 response fields and schema

```json
{
  "type": "string"
}
```

## GET /v1/jobs/{job_id}/logs/stream

Stream job logs

```bash
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/jobs/{job_id}/logs/stream
```

### Parameters

| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
| job_id | path | string | Required |  | format: uuid |
| stage | query | string or null | Optional |  |  |
| batch | query | integer or null | Optional |  |  |
| follow | query | boolean | Optional | true |  |
| tail | query | integer or null | Optional |  |  |
| since | query | integer or null | Optional |  |  |

Returns 200 or 422.

### 200 response (text/event-stream)

### 200 response fields and schema

```json
{
  "type": "string"
}
```

## GET /v1/log-settings

Get log settings

```bash
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/log-settings
```

### Parameters

| Name | In | Type | Required |
|---|---|---|---|
| project_id | query | string or null | Optional |

Returns 200 or 422.

### 200 response (application/json)

### 200 response fields and schema

```json
{
  "$ref": "#/$defs/EffectiveLogSettings",
  "$defs": {
    "EffectiveLogSettings": {
      "type": "object",
      "required": [
        "logs_enabled",
        "retention_seconds",
        "max_pod_bytes",
        "tail_lines_default",
        "heartbeat_interval_seconds"
      ],
      "properties": {
        "logs_enabled": {
          "type": "boolean"
        },
        "retention_seconds": {
          "type": "integer"
        },
        "max_pod_bytes": {
          "type": "integer"
        },
        "tail_lines_default": {
          "type": "integer"
        },
        "heartbeat_interval_seconds": {
          "type": "integer"
        }
      }
    }
  }
}
```

Illustrative response shape. Values are placeholders, not a recorded result.

```json
{
  "logs_enabled": false,
  "retention_seconds": 0,
  "max_pod_bytes": 0,
  "tail_lines_default": 0,
  "heartbeat_interval_seconds": 0
}
```

## PATCH /v1/log-settings

Change log settings

Only an organization admin can use this.

```bash
curl -H "x-api-key: $PHI_KEY" -X PATCH https://api.dynophi.com/v1/log-settings \
  -H "content-type: application/json" \
  -d '{}'
```

### Parameters

| Name | In | Type | Required |
|---|---|---|---|
| project_id | query | string or null | Optional |

### Body

| Field | Type | Required |
|---|---|---|
| logs_enabled | boolean or null | Optional |
| retention_seconds | integer or null | Optional |
| max_pod_bytes | integer or null | Optional |
| tail_lines_default | integer or null | Optional |
| heartbeat_interval_seconds | integer or null | Optional |

Returns 200 or 422.

### Complete request schema

```json
{
  "$ref": "#/$defs/LogSettingsUpdate",
  "$defs": {
    "LogSettingsUpdate": {
      "type": "object",
      "properties": {
        "logs_enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "retention_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "max_pod_bytes": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "tail_lines_default": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "heartbeat_interval_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  }
}
```

### 200 response (application/json)

### 200 response fields and schema

```json
{
  "$ref": "#/$defs/EffectiveLogSettings",
  "$defs": {
    "EffectiveLogSettings": {
      "type": "object",
      "required": [
        "logs_enabled",
        "retention_seconds",
        "max_pod_bytes",
        "tail_lines_default",
        "heartbeat_interval_seconds"
      ],
      "properties": {
        "logs_enabled": {
          "type": "boolean"
        },
        "retention_seconds": {
          "type": "integer"
        },
        "max_pod_bytes": {
          "type": "integer"
        },
        "tail_lines_default": {
          "type": "integer"
        },
        "heartbeat_interval_seconds": {
          "type": "integer"
        }
      }
    }
  }
}
```

Illustrative response shape. Values are placeholders, not a recorded result.

```json
{
  "logs_enabled": false,
  "retention_seconds": 0,
  "max_pod_bytes": 0,
  "tail_lines_default": 0,
  "heartbeat_interval_seconds": 0
}
```

## GET /v1/runs/{run_id}/logs

Get run logs

```bash
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/runs/{run_id}/logs
```

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| run_id | path | string | Required | format: uuid |
| stage | query | string or null | Optional |  |
| batch | query | integer or null | Optional |  |
| pod | query | string or null | Optional |  |

Returns 200 or 422.

### 200 response (text/plain)

### 200 response fields and schema

```json
{
  "type": "string"
}
```

## GET /v1/runs/{run_id}/logs/download

Download run logs

```bash
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/runs/{run_id}/logs/download
```

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| run_id | path | string | Required | format: uuid |
| stage | query | string or null | Optional |  |
| batch | query | integer or null | Optional |  |
| pod | query | string or null | Optional |  |

Returns 200 or 422.

### 200 response (text/plain)

### 200 response fields and schema

```json
{
  "type": "string"
}
```

## GET /v1/runs/{run_id}/logs/stream

Stream run logs

```bash
curl -H "x-api-key: $PHI_KEY" https://api.dynophi.com/v1/runs/{run_id}/logs/stream
```

### Parameters

| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
| run_id | path | string | Required |  | format: uuid |
| stage | query | string or null | Optional |  |  |
| batch | query | integer or null | Optional |  |  |
| follow | query | boolean | Optional | true |  |
| tail | query | integer or null | Optional |  |  |
| since | query | integer or null | Optional |  |  |

Returns 200 or 422.

### 200 response (text/event-stream)

### 200 response fields and schema

```json
{
  "type": "string"
}
```


---
Source: https://dynophi.com/docs/api/logs. From phi-api 0.2.2, 2026-11-23.
