Skip to main content

List All Clients

Retrieve a list of all clients in your workspace with their health scores and metrics.
workspaceId
string
required
Your workspace domain (e.g., yourcompany.com)

Request

curl -X GET "https://api.gostanna.com/api/clients?workspaceId=yourcompany.com" \
  -H "Authorization: Bearer sk-your-api-key-here"

Response

[
  {
    "id": "client_123",
    "name": "Acme Corp",
    "domain": "acme.com",
    "sentimentScore": 85,
    "lastInteraction": "2024-01-15T10:30:00Z",
    "mrr": 5000,
    "renewalDate": "2024-06-01",
    "csmOwner": "john.doe@yourcompany.com",
    "isExcluded": false,
    "createdAt": "2023-01-01T00:00:00Z",
    "updatedAt": "2024-01-15T10:30:00Z"
  }
]

Response Fields

FieldTypeDescription
idstringUnique client identifier
namestringClient company name
domainstringClient’s domain
sentimentScorenumberHealth score (0-100)
lastInteractionstringISO 8601 timestamp of last contact
mrrnumberMonthly recurring revenue
renewalDatestringNext renewal date (YYYY-MM-DD)
csmOwnerstringAssigned CSM email
isExcludedbooleanWhether client is excluded from metrics

Get Client Details

Retrieve detailed information about a specific client.
clientId
string
required
The client’s unique identifier
workspaceId
string
required
Your workspace domain

Request

curl -X GET "https://api.gostanna.com/api/clients/client_123?workspaceId=yourcompany.com" \
  -H "Authorization: Bearer sk-your-api-key-here"

Response

{
  "client": {
    "id": "client_123",
    "name": "Acme Corp",
    "domain": "acme.com",
    "sentimentScore": 85,
    "lastInteraction": "2024-01-15T10:30:00Z",
    "mrr": 5000,
    "renewalDate": "2024-06-01",
    "csmOwner": "john.doe@yourcompany.com",
    "isExcluded": false
  },
  "metrics": {
    "totalInteractions": 156,
    "avgResponseTime": 2.5,
    "lastMonthInteractions": 12,
    "sentimentTrend": "improving"
  },
  "contacts": [
    {
      "email": "contact@acme.com",
      "name": "Jane Smith",
      "title": "CEO",
      "lastSeen": "2024-01-15T10:30:00Z"
    }
  ]
}

Get Client Interactions

Retrieve interaction history for a specific client.
clientId
string
required
The client’s unique identifier
workspaceId
string
required
Your workspace domain
limit
number
Maximum number of interactions to return (default: 50, max: 200)
offset
number
Number of interactions to skip for pagination (default: 0)

Request

curl -X GET "https://api.gostanna.com/api/clients/client_123/interactions?workspaceId=yourcompany.com&limit=10" \
  -H "Authorization: Bearer sk-your-api-key-here"

Response

{
  "interactions": [
    {
      "id": "int_456",
      "type": "email",
      "subject": "Re: Product Update",
      "sentiment": "positive",
      "date": "2024-01-15T10:30:00Z",
      "from": "contact@acme.com",
      "to": "support@yourcompany.com",
      "summary": "Client expressed satisfaction with recent updates"
    }
  ],
  "pagination": {
    "total": 156,
    "limit": 10,
    "offset": 0,
    "hasMore": true
  }
}

Get Last Interactions

Get the last interaction timestamp for all clients.
workspaceId
string
required
Your workspace domain

Request

curl -X GET "https://api.gostanna.com/api/clients/last-interactions?workspaceId=yourcompany.com" \
  -H "Authorization: Bearer sk-your-api-key-here"

Response

{
  "client_123": "2024-01-15T10:30:00Z",
  "client_124": "2024-01-14T15:45:00Z",
  "client_125": "2024-01-13T08:20:00Z"
}
The response is a map of client IDs to their last interaction timestamps.