GET
/
api
/
dashboard
/
getInteractions
Get Dashboard Interactions
curl --request GET \
  --url https://asteragents.com/api/api/dashboard/getInteractions \
  --header 'Authorization: Bearer <token>'
{
  "403": {},
  "500": {},
  "id": "<string>",
  "agentId": 123,
  "upstreamConversationId": "<string>",
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "agentName": "<string>",
  "agentModel": "<string>",
  "agentLogoUrl": "<string>",
  "userId": "<string>",
  "userEmail": "<string>",
  "userFirstName": "<string>",
  "userLastName": "<string>",
  "userPublicMetadata": {},
  "firstMessageText": "<string>",
  "userMessageCount": 123,
  "assistantMessageCount": 123,
  "totalMessageCount": 123,
  "duration": 123,
  "totalTokens": 123,
  "attachmentCount": 123,
  "toolCalls": [
    {
      "toolName": "<string>",
      "args": {},
      "result": "<any>"
    }
  ],
  "lastFinishReason": "<string>",
  "totalFeedback": 123,
  "totalHelpful": 123,
  "totalNotHelpful": 123,
  "feedbackData": [
    {}
  ],
  "subConversations": [
    {}
  ]
}
Returns comprehensive conversation data including user details, agent information, usage metrics, and tool invocations.

Authentication

This endpoint requires a valid JWT token from Clerk authentication. The token must include organization membership.

Query Parameters

from
string
required
Start date for the query range (ISO 8601 format, e.g., “2024-01-01T00:00:00.000Z”)
to
string
required
End date for the query range (ISO 8601 format, e.g., “2024-12-31T23:59:59.999Z”)
allInOrg
boolean
default:"false"
Whether to include conversations for all users in the organization. Requires org:admin role.
userId
string
Filter results to a specific user ID (admin only when allInOrg is true)
metadataKey
string
Filter by a specific metadata key in user’s publicMetadata
metadataValue
string
Filter by a specific metadata value. Can be used with or without metadataKey.

Response

Returns an array of conversation objects, organized hierarchically with sub-conversations nested under their parent conversations.
id
string
Unique conversation identifier
agentId
number
ID of the agent used in this conversation
upstreamConversationId
string
Parent conversation ID if this is a sub-conversation
createdAt
string
ISO 8601 timestamp when conversation was created
updatedAt
string
ISO 8601 timestamp when conversation was last updated
agentName
string
Display name of the agent
agentModel
string
AI model used by the agent (e.g., “gpt-4”, “claude-3-sonnet”)
agentLogoUrl
string
URL to the agent’s logo/avatar image
userId
string
Clerk user ID of the conversation participant
userEmail
string
Email address of the user
userFirstName
string
User’s first name
userLastName
string
User’s last name
userPublicMetadata
object
Custom metadata associated with the user
firstMessageText
string
Text content of the first message in the conversation
userMessageCount
number
Number of messages sent by the user
assistantMessageCount
number
Number of messages sent by the assistant
totalMessageCount
number
Total number of messages in the conversation
duration
number
Conversation duration in seconds
totalTokens
number
Total token usage for this conversation
attachmentCount
number
Number of file attachments in the conversation
toolCalls
array
Array of all tool invocations made during the conversation
lastFinishReason
string
Reason the last message generation finished (e.g., “stop”, “length”, “tool_calls”)
totalFeedback
number
Total number of feedback responses for this conversation
totalHelpful
number
Number of positive feedback responses
totalNotHelpful
number
Number of negative feedback responses
feedbackData
array
Detailed feedback data with timestamps and comments
subConversations
array
Array of nested sub-conversations (same structure as parent)

Examples

curl -X GET "https://asteragents.com/api/dashboard/getInteractions?from=2024-01-01T00:00:00.000Z&to=2024-12-31T23:59:59.999Z&allInOrg=true" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Error Codes

403
object
Forbidden - User lacks required permissions (e.g., non-admin trying to use allInOrg=true)
500
object
Internal Server Error - Server encountered an unexpected condition

Notes

  • Results are ordered by updatedAt in descending order (most recent first)
  • Conversations marked as deleted (deletedAt is not null) are excluded from results
  • Sub-conversations are nested under their parent conversation in the subConversations array
  • Tool calls include the complete invocation data with arguments and results
  • Metadata filtering supports flexible querying across user’s publicMetadata JSON field
  • All dates are returned in ISO 8601 format
  • When allInOrg=true, only users with org:admin role can access organization-wide data