Skip to main content
POST
/
agents
/
{agent_id}
/
logs
Create Agent Log
curl --request POST \
  --url https://api.example.com/agents/{agent_id}/logs \
  --header 'Content-Type: application/json' \
  --data '
{
  "log_type": "trigger_fired",
  "message": "<string>",
  "instance_id": "<string>",
  "metadata": {}
}
'
{
  "organization_id": "<string>",
  "agent_resource_id": "<string>",
  "log_type": "trigger_fired",
  "message": "<string>",
  "id": "<string>",
  "instance_id": "<string>",
  "metadata": {},
  "timestamp": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z"
}

Path Parameters

agent_id
string
required

Body

application/json

Request body for creating an agent log entry.

Attributes: log_type: Category of this log entry. message: Human-readable description of what happened. instance_id: Agent instance that produced this log entry. metadata: Flexible payload (tool name, arguments, error details, etc.).

log_type
enum<string>
required

Types of agent log entries.

Available options:
trigger_fired,
agent_started,
agent_completed,
agent_error,
tool_call,
tool_result,
reasoning,
decision,
plan_created,
plan_updated,
step_started,
step_completed
message
string
required
instance_id
string | null
metadata
Metadata · object

Response

Successful Response

A recorded action or decision by an AI agent.

Attributes: id: SurrealDB record ID (populated by database). organization_id: Tenant that owns the agent. agent_resource_id: SurrealDB ID of the agent resource. instance_id: Agent instance that produced this log entry. log_type: Category of this log entry. message: Human-readable description of what happened. metadata: Flexible payload (tool name, arguments, error details, etc.). timestamp: When this action occurred. expires_at: When this log entry should be garbage collected.

organization_id
string
required
agent_resource_id
string
required
log_type
enum<string>
required

Types of agent log entries.

Available options:
trigger_fired,
agent_started,
agent_completed,
agent_error,
tool_call,
tool_result,
reasoning,
decision,
plan_created,
plan_updated,
step_started,
step_completed
message
string
required
id
string | null
instance_id
string | null
metadata
Metadata · object
timestamp
string<date-time>
expires_at
string<date-time>