# Get Log Details

`GET /api/v1/logs/{id}`

## Description
Retrieve detailed information about a specific log entry, including workflow metadata, execution data, and cost breakdown.

## Parameters

- **id** (path) (required) — `string`: The unique identifier of the log entry.

## Responses

### 200 — Detailed log entry with full execution data and cost breakdown.

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "description": "Detailed log entry with full execution data, workflow metadata, and cost breakdown.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique log entry identifier.",
          "example": "log_7x8y9z0a1b"
        },
        "workflowId": {
          "type": "string",
          "description": "The workflow that was executed.",
          "example": "wf_1a2b3c4d5e"
        },
        "executionId": {
          "type": "string",
          "description": "Unique execution identifier for this run.",
          "example": "exec_9f8e7d6c5b"
        },
        "level": {
          "type": "string",
          "description": "Log severity. info for successful executions, error for failures.",
          "example": "info"
        },
        "trigger": {
          "type": "string",
          "description": "How the execution was triggered (e.g., api, manual, webhook, schedule, chat).",
          "example": "api"
        },
        "startedAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when execution started.",
          "example": "2025-06-20T14:15:22Z"
        },
        "endedAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when execution completed.",
          "example": "2025-06-20T14:15:23Z"
        },
        "totalDurationMs": {
          "type": "integer",
          "description": "Total execution duration in milliseconds.",
          "example": 1250
        },
        "workflow": {
          "type": "object",
          "description": "Summary metadata about the workflow at the time of execution.",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique workflow identifier.",
              "example": "wf_1a2b3c4d5e"
            },
            "name": {
              "type": "string",
              "description": "Workflow name at the time of execution.",
              "example": "Customer Support Agent"
            },
            "description": {
              "type": "string",
              "nullable": true,
              "description": "Workflow description at the time of execution.",
              "example": "Routes incoming support tickets and drafts responses"
            }
          }
        },
        "executionData": {
          "type": "object",
          "description": "Detailed execution data including block-level traces and final output.",
          "properties": {
            "traceSpans": {
              "type": "array",
              "description": "Block-level execution traces with timing, inputs, and outputs for each block that ran.",
              "items": {
                "type": "object"
              }
            },
            "finalOutput": {
              "type": "object",
              "description": "The workflow's final output after all blocks completed."
            }
          }
        },
        "cost": {
          "type": "object",
          "description": "Detailed cost breakdown for this execution.",
          "properties": {
            "total": {
              "type": "number",
              "description": "Total cost of this execution in USD.",
              "example": 0.0032
            },
            "tokens": {
              "type": "object",
              "description": "Aggregate token usage across all AI model calls in this execution.",
              "properties": {
                "prompt": {
                  "type": "integer",
                  "description": "Total prompt (input) tokens consumed.",
                  "example": 450
                },
                "completion": {
                  "type": "integer",
                  "description": "Total completion (output) tokens generated.",
                  "example": 120
                },
                "total": {
                  "type": "integer",
                  "description": "Total tokens (prompt + completion).",
                  "example": 570
                }
              }
            },
            "models": {
              "type": "object",
              "description": "Per-model cost and token breakdown. Keys are model identifiers (e.g., gpt-4o, claude-sonnet-4-20250514).",
              "additionalProperties": {
                "type": "object",
                "description": "Cost and token details for a specific model.",
                "properties": {
                  "input": {
                    "type": "number",
                    "description": "Cost of prompt tokens for this model in USD."
                  },
                  "output": {
                    "type": "number",
                    "description": "Cost of completion tokens for this model in USD."
                  },
                  "total": {
                    "type": "number",
                    "description": "Total cost for this model in USD."
                  },
                  "tokens": {
                    "type": "object",
                    "description": "Token usage for this specific model.",
                    "properties": {
                      "prompt": {
                        "type": "integer",
                        "description": "Prompt tokens consumed by this model."
                      },
                      "completion": {
                        "type": "integer",
                        "description": "Completion tokens generated by this model."
                      },
                      "total": {
                        "type": "integer",
                        "description": "Total tokens for this model."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "limits": {
      "type": "object",
      "description": "Rate limit and usage information attached to the /api/v1 workflows, logs, and audit logs responses. The Execute Workflow and Get Job Status responses do not include it.",
      "properties": {
        "workflowExecutionRateLimit": {
          "type": "object",
          "description": "Current rate limit status for workflow executions.",
          "properties": {
            "sync": {
              "description": "Rate limit bucket for synchronous executions.",
              "$ref": "#/components/schemas/RateLimitBucket"
            },
            "async": {
              "description": "Rate limit bucket for asynchronous executions.",
              "$ref": "#/components/schemas/RateLimitBucket"
            }
          }
        },
        "usage": {
          "type": "object",
          "description": "Current billing period usage and plan limits.",
          "properties": {
            "currentPeriodCost": {
              "type": "number",
              "description": "Total spend in the current billing period in USD.",
              "example": 1.25
            },
            "limit": {
              "type": "number",
              "description": "Maximum allowed spend for the current billing period in USD.",
              "example": 50
            },
            "plan": {
              "type": "string",
              "description": "Your current subscription plan (e.g., free, pro, team).",
              "example": "pro"
            },
            "isExceeded": {
              "type": "boolean",
              "description": "Whether the usage limit has been exceeded. Executions may be blocked when true.",
              "example": false
            }
          }
        }
      }
    }
  }
}
```

### 401 — Invalid or missing API key. Ensure the X-API-Key header is set with a valid key.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 404 — The requested resource was not found. Verify the ID is correct and belongs to your workspace.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 429 — Rate limit exceeded. Wait for the duration specified in the Retry-After header before retrying.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message with rate limit details."
    }
  }
}
```
