Generate report
Queue a new report for generation. Reports are generated asynchronously by a background worker.
Report types:
campaign— Generate a report for specific campaigns (1-10). Creates one report per campaign.workspace— Generate a report covering all workspace activity.organizational— Generate a report aggregating all workspaces owned by the authenticated user.
The report is created with status queued and processed in the background. Use webhooks or poll the report status to know when it's ready.
curl -X POST "https://api.sendkit.ai/v1/reports" \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"reportType": "campaign",
"campaignIds": [
"664f0a1b2c3d4e5f6a7b8c01",
"664f0a1b2c3d4e5f6a7b8c02"
],
"periodStart": "2026-01-01",
"periodEnd": "2026-04-17",
"sections": {
"executiveSummary": true,
"campaignPerformance": true,
"mailboxHealth": false
}
}'
import requests
import json
url = "https://api.sendkit.ai/v1/reports"
headers = {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
}
data = {
"reportType": "campaign",
"campaignIds": [
"664f0a1b2c3d4e5f6a7b8c01",
"664f0a1b2c3d4e5f6a7b8c02"
],
"periodStart": "2026-01-01",
"periodEnd": "2026-04-17",
"sections": {
"executiveSummary": true,
"campaignPerformance": true,
"mailboxHealth": false
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.sendkit.ai/v1/reports", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"reportType": "campaign",
"campaignIds": [
"664f0a1b2c3d4e5f6a7b8c01",
"664f0a1b2c3d4e5f6a7b8c02"
],
"periodStart": "2026-01-01",
"periodEnd": "2026-04-17",
"sections": {
"executiveSummary": true,
"campaignPerformance": true,
"mailboxHealth": false
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"reportType": "campaign",
"campaignIds": [
"664f0a1b2c3d4e5f6a7b8c01",
"664f0a1b2c3d4e5f6a7b8c02"
],
"periodStart": "2026-01-01",
"periodEnd": "2026-04-17",
"sections": {
"executiveSummary": true,
"campaignPerformance": true,
"mailboxHealth": false
}
}`)
req, err := http.NewRequest("POST", "https://api.sendkit.ai/v1/reports", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.sendkit.ai/v1/reports')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-Api-Key'] = 'YOUR_API_KEY'
request.body = '{
"reportType": "campaign",
"campaignIds": [
"664f0a1b2c3d4e5f6a7b8c01",
"664f0a1b2c3d4e5f6a7b8c02"
],
"periodStart": "2026-01-01",
"periodEnd": "2026-04-17",
"sections": {
"executiveSummary": true,
"campaignPerformance": true,
"mailboxHealth": false
}
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"reports": [
{
"id": "666f1a2b3c4d5e6f7a8b9c10",
"title": "Q1 Outreach Report",
"reportType": "campaign",
"status": "queued"
},
{
"id": "666f1a2b3c4d5e6f7a8b9c11",
"title": "Follow-up Campaign Report",
"reportType": "campaign",
"status": "queued"
}
],
"message": "2 reports queued for generation"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
/v1/reports
Platform API key (sk_user_...) or Workspace API key (sk_...)
The media type of the request body
Type of report to generate
Campaign IDs to include (required for campaign type, max 10)
Optional period start date (ISO 8601 or YYYY-MM-DD)
Optional period end date (ISO 8601 or YYYY-MM-DD)
Recipient IDs to send the report to immediately
Toggle which sections to include in the report. All default to true.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)
Body
Campaign IDs to include (required for campaign type, max 10)
Optional period start date (ISO 8601 or YYYY-MM-DD)
Optional period end date (ISO 8601 or YYYY-MM-DD)
Recipient IDs to send the report to immediately
Toggle which sections to include in the report. All default to true.
Responses
falsefalseLast updated today
Built with Documentation.AI