> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pragmatiks.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List Agent Actions

> Query the merged timeline of events and logs for an agent.

Returns lifecycle events (where actor matches the agent) and agent
log entries merged into a unified timeline, sorted by timestamp
descending.

Returns:
    Merged timeline entries for the agent.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json get /projects/{project_id}/agents/{agent_id}/actions
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /projects/{project_id}/agents/{agent_id}/actions:
    get:
      tags:
        - agents
      summary: List Agent Actions
      description: |-
        Query the merged timeline of events and logs for an agent.

        Returns lifecycle events (where actor matches the agent) and agent
        log entries merged into a unified timeline, sorted by timestamp
        descending.

        Returns:
            Merged timeline entries for the agent.
      operationId: agents-list_agent_actions
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            title: Project Id
        - name: since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Start of time window (ISO 8601). Defaults to 1 hour ago.
            title: Since
          description: Start of time window (ISO 8601). Defaults to 1 hour ago.
        - name: until
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: End of time window (ISO 8601). Defaults to now.
            title: Until
          description: End of time window (ISO 8601). Defaults to now.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 500
            minimum: 1
            description: Maximum entries to return.
            default: 50
            title: Limit
          description: Maximum entries to return.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgentActionEntry'
                title: Response Agents-List Agent Actions
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AgentActionEntry:
      properties:
        source:
          type: string
          enum:
            - event
            - log
          title: Source
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        event:
          anyOf:
            - $ref: '#/components/schemas/LifecycleEvent'
            - type: 'null'
        log:
          anyOf:
            - $ref: '#/components/schemas/AgentLog'
            - type: 'null'
      type: object
      required:
        - source
        - timestamp
      title: AgentActionEntry
      description: |-
        Unified timeline entry combining lifecycle events and agent logs.

        Attributes:
            source: Whether this entry originated from a lifecycle event or an agent log.
            timestamp: When this action occurred.
            event: Lifecycle event data (populated when source is "event").
            log: Agent log data (populated when source is "log").
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LifecycleEvent:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        organization_id:
          type: string
          title: Organization Id
        resource_id:
          type: string
          title: Resource Id
        resource_name:
          type: string
          title: Resource Name
        provider:
          type: string
          title: Provider
        resource_type:
          type: string
          title: Resource Type
        event_type:
          type: string
          title: Event Type
        from_state:
          anyOf:
            - $ref: '#/components/schemas/LifecycleState'
            - type: 'null'
        to_state:
          $ref: '#/components/schemas/LifecycleState'
        actor_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Actor Type
        actor_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Actor Id
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        expires_at:
          type: string
          format: date-time
          title: Expires At
      type: object
      required:
        - organization_id
        - resource_id
        - resource_name
        - provider
        - resource_type
        - event_type
        - to_state
      title: LifecycleEvent
      description: |-
        A recorded lifecycle state transition for a resource.

        Attributes:
            id: SurrealDB record ID (populated by database).
            organization_id: Tenant that owns the resource.
            resource_id: SurrealDB resource ID.
            resource_name: Human-readable resource name.
            provider: Provider that manages the resource.
            resource_type: Resource type name.
            event_type: Lifecycle event that caused the transition (e.g. apply, success, failure).
            from_state: State before transition, None for initial creation.
            to_state: State after transition.
            actor_type: Who caused this event ("user", "agent", "system"), None for legacy events.
            actor_id: Identifier for the actor (user ID or agent resource ID), None for legacy events.
            error: Error message when transitioning to FAILED state.
            timestamp: When the transition occurred.
            expires_at: When this event should be garbage collected.
    AgentLog:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        agent_resource_id:
          type: string
          title: Agent Resource Id
        instance_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Instance Id
        log_type:
          $ref: '#/components/schemas/AgentLogType'
        message:
          type: string
          title: Message
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        expires_at:
          type: string
          format: date-time
          title: Expires At
      type: object
      required:
        - agent_resource_id
        - log_type
        - message
      title: AgentLog
      description: |-
        A recorded action or decision by an AI agent.

        Agent logs live inside each organization's SurrealDB namespace —
        the namespace is the organization boundary, so no per-record
        ``organization_id`` field is carried on the row.

        Attributes:
            id: SurrealDB record ID (populated by database).
            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.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    LifecycleState:
      type: string
      enum:
        - draft
        - waiting
        - pending
        - processing
        - ready
        - failed
        - deleting
      title: LifecycleState
      description: Lifecycle states for resources.
    AgentLogType:
      type: string
      enum:
        - trigger_fired
        - agent_started
        - agent_completed
        - agent_error
        - tool_call
        - tool_result
        - reasoning
        - decision
        - plan_created
        - plan_updated
        - step_started
        - step_completed
      title: AgentLogType
      description: Types of agent log entries.

````