godo.Signals.ListAgentSessions()

Generated on 5 Nov 2026 from godo version v1.236.0

Usage

client.Signals.ListAgentSessions(ctx context.Context, agentID string, opts *godo.SignalsListAgentSessionsOptions) (*godo.SignalsListAgentSessionsResponse, *godo.Response, error)

Description

ListAgentSessions lists sessions for an agent.

This method sends a GET request to /v1/signals/agents/{}/sessions.

Parameters

agentID string required
opts *godo.SignalsListAgentSessionsOptions

Fields of godo.SignalsListAgentSessionsOptions

SignalsListAgentSessionsOptions are query params for GET /agents/{id}/sessions.

SignalsCursorPageOptions godo.SignalsCursorPageOptions
StartTime *int64
EndTime *int64
SignalType []string

Returns

*godo.SignalsListAgentSessionsResponse
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.SignalsListAgentSessionsResponse

SignalsListAgentSessionsResponse is GET /agents/{environment_id}/sessions.

Edges []godo.SignalsSessionEdge

JSON key: edges

PageInfo godo.SignalsPageInfo

JSON key: page_info

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.Signals.ListAgentSessions(ctx, "<your-agent-id>", &godo.SignalsListAgentSessionsOptions{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

Response Example

Show Response Example
{
  "edges": [
    {
      "cursor": "eyJ0ZWFtX2lkIjozOTQ0OTk0Nn0=",
      "node": {
        "session_id": "01a0f3d5-d5f1-798a-9352-2cd8f8b81e78",
        "total_turns": 5,
        "started_at": "2026-09-15T14:30:00Z",
        "duration_seconds": 120.5,
        "signal_count": 3
      }
    }
  ],
  "page_info": {
    "has_next_page": false
  }
}

More Information

See GET /v1/signals/agents/{}/sessions in the API reference for additional detail on responses, headers, parameters, and more.

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.