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

# Get thread activity

> Fetch compact current and recent activity for a thread without returning transcript content or runtime debug state.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /agents/{agentId}/threads/{threadId}/activity
openapi: 3.1.0
info:
  description: API-key accessible routes for Cerca agents.
  title: Cerca API
  version: 0.0.0
servers:
  - url: https://api.cerca.dev
security:
  - bearerAuth: []
paths:
  /agents/{agentId}/threads/{threadId}/activity:
    get:
      tags:
        - Threads
      summary: Get thread activity
      description: >-
        Fetch compact current and recent activity for a thread without returning
        transcript content or runtime debug state.
      parameters:
        - schema:
            type: string
            minLength: 1
            example: agent_abc123
          required: true
          in: path
          name: agentId
        - schema:
            type: string
            minLength: 1
            example: thread_abc123
          required: true
          in: path
          name: threadId
        - schema:
            type: string
            description: Optional fleet id for index-backed authorization.
          required: false
          description: Optional fleet id for index-backed authorization.
          name: fleetId
          in: query
      responses:
        '200':
          description: Thread activity detail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadActivityDetail'
        '400':
          description: Invalid runtime request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Access denied or non-transient quota exceeded. Limit errors include
            a stable code field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Runtime resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Thread lifecycle conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Transient capacity limit exceeded. Limit errors include a stable
            code field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Thread lifecycle operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Required runtime dependency unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          description: Runtime error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Cerca from '@cerca-dev/sdk';


            const client = new Cerca({
              apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
            });


            const activityDetail = await client.threads.activity('agent_abc123',
            'thread_abc123');


            console.log(activityDetail);
        - lang: Python
          source: |-
            import os
            from cerca import Cerca

            client = Cerca(
                api_key=os.environ.get("CERCA_API_KEY"),  # This is the default and can be omitted
            )
            activity_detail = client.threads.activity(
                agent_id="agent_abc123",
                thread_id="thread_abc123",
            )
            print(activity_detail)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/matrices/cerca-go\"\n\t\"github.com/matrices/cerca-go/option\"\n)\n\nfunc main() {\n\tclient := cercago.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tactivityDetail, err := client.Threads.Activity(\n\t\tcontext.TODO(),\n\t\t\"agent_abc123\",\n\t\t\"thread_abc123\",\n\t\tcercago.ThreadActivityParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", activityDetail)\n}\n"
        - lang: Ruby
          source: >-
            require "cerca"


            cerca = Cerca::Client.new(api_key: "My API Key")


            activity_detail = cerca.threads.activity("agent_abc123",
            "thread_abc123")


            puts(activity_detail)
        - lang: CLI
          source: |-
            cerca threads activity \
              --api-key 'My API Key' \
              --agent-id agent_abc123 \
              --thread-id thread_abc123
components:
  schemas:
    ThreadActivityDetail:
      allOf:
        - $ref: '#/components/schemas/ThreadActivitySummary'
        - type: object
          properties:
            error:
              type:
                - string
                - 'null'
            recentTurns:
              type: array
              items:
                $ref: '#/components/schemas/ThreadTurnSummary'
          required:
            - error
            - recentTurns
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine-readable error code when the API can provide one.
          example: MONTHLY_TOKEN_BUDGET_EXCEEDED
      required:
        - error
    ThreadActivitySummary:
      type: object
      properties:
        completedAt:
          type:
            - string
            - 'null'
        createdAt:
          type: string
        goal:
          type: string
        id:
          type: string
        latestActivity:
          type:
            - string
            - 'null'
        messageCount:
          type: number
        model:
          type: string
        nextStep:
          type:
            - string
            - 'null'
        parentThreadId:
          type:
            - string
            - 'null'
        result:
          type:
            - string
            - 'null'
        scheduleId:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/ThreadStatus'
        stepCount:
          type: number
        updatedAt:
          type: string
      required:
        - completedAt
        - createdAt
        - goal
        - id
        - latestActivity
        - messageCount
        - model
        - nextStep
        - parentThreadId
        - result
        - scheduleId
        - status
        - stepCount
        - updatedAt
    ThreadTurnSummary:
      type: object
      properties:
        activity:
          type:
            - string
            - 'null'
        completedAt:
          type: string
        messageCount:
          type: number
        nextStep:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - completed
            - failed
        turnSeq:
          type: number
      required:
        - activity
        - completedAt
        - messageCount
        - nextStep
        - status
        - turnSeq
    ThreadStatus:
      type: string
      enum:
        - idle
        - running
        - awaiting
        - closed
      description: >-
        `idle` threads can accept a new turn or be closed. `running` threads
        have an active turn. `awaiting` threads are paused on external input
        such as approvals. `closed` threads are terminal.
  securitySchemes:
    bearerAuth:
      bearerFormat: Cerca API key
      scheme: bearer
      type: http

````