agentlyleads docs
Reports API

API Reference

The reference below covers every endpoint in the Reports API. Code examples are generated automatically; the live playground is disabled to prevent accidental writes to production from the docs site.

GET/api/v1/reports

Authorization

BearerAuth
AuthorizationBearer <token>

Pass an API key issued from the agentlyleads workspace settings. Example: Authorization: Bearer alk_live_xxxxxxxxxxxx

In: header

Query Parameters

range?string
Default"this-month"

Value in

  • "this-month"
  • "last-month"
  • "quarter"
  • "custom"
from?string

With range=custom (implied when from/to are sent). YYYY-MM-DD.

Formatdate
to?string

Inclusive. At most 366 days after from.

Formatdate
ownerId?string

Narrow every section to one user of this workspace.

sections?string

Comma-separated subset of forecast, outreach, activity, winLoss. Default all.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/reports"
{  "report": {    "range": {      "preset": "string",      "from": "2019-08-24T14:15:22Z",      "to": "2019-08-24T14:15:22Z"    },    "ownerId": "string",    "forecast": {      "stageProbability": {        "property1": 0,        "property2": 0      },      "months": [        {          "month": "2026-09",          "byStage": {            "property1": {              "count": 0,              "value": 0,              "weighted": 0            },            "property2": {              "count": 0,              "value": 0,              "weighted": 0            }          },          "totalValue": 0,          "totalWeighted": 0        }      ],      "noCloseDate": {        "count": 0,        "value": 0      },      "totalValue": 0,      "totalWeighted": 0    },    "outreach": {      "campaigns": [        {          "campaignId": "string",          "name": "string",          "status": "string",          "sent": 0,          "delivered": 0,          "replies": 0,          "positiveReplies": 0,          "unsubscribes": 0,          "replyRate": 0,          "positiveReplyRate": 0,          "unsubscribeRate": 0        }      ],      "repliesByWeek": [        0      ]    },    "activity": [      {        "userId": "string",        "name": "string",        "emailsSent": 0,        "repliesReceived": 0,        "callsAndNotes": 0,        "tasksCompleted": 0,        "dealsMovedStage": 0,        "total": 0      }    ],    "winLoss": {      "rows": [        {          "source": "string",          "wonCount": 0,          "wonValue": 0,          "lostCount": 0,          "lostValue": 0,          "avgDaysToClose": 0        }      ],      "totals": {        "wonCount": 0,        "wonValue": 0,        "lostCount": 0,        "lostValue": 0,        "winRate": 0      }    }  }}
{  "error": "products must not be empty."}
{  "error": "Invalid or missing API key."}
{  "error": "API key missing required scope: write:workflows."}
GET/api/v1/saved-views

Authorization

BearerAuth
AuthorizationBearer <token>

Pass an API key issued from the agentlyleads workspace settings. Example: Authorization: Bearer alk_live_xxxxxxxxxxxx

In: header

Query Parameters

entity?string

Value in

  • "CONTACT"
  • "LEAD"
  • "DEAL"
  • "COMPANY"
  • "EMAIL"

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/saved-views"
{  "savedViews": [    {      "id": "string",      "entity": "CONTACT",      "name": "string",      "config": {},      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ]}
{  "error": "products must not be empty."}
{  "error": "Invalid or missing API key."}
{  "error": "API key missing required scope: write:workflows."}