Skip to main content

Create Report

Create a new saved report for a website. Reports allow you to save and reuse specific analytics configurations.

Endpoint

POST /api/reports

Headers

Authorization
string
required
Bearer token for authentication

Request Body

websiteId
string
required
Website UUID
type
string
required
Report type. Must be one of:
  • attribution - Attribution analysis
  • breakdown - Multi-dimensional breakdown
  • funnel - Conversion funnel analysis
  • goal - Goal tracking
  • journey - User journey paths
  • retention - User retention cohorts
  • revenue - Revenue tracking
  • utm - UTM campaign analysis
name
string
required
Report name (max 200 characters)
description
string
Report description (max 500 characters)
parameters
object
required
Report-specific parameters (varies by report type)

Report Parameters by Type

Response

id
string
Report UUID
websiteId
string
Website UUID
userId
string
User who created the report
type
string
Report type
name
string
Report name
description
string
Report description
parameters
object
Report parameters
createdAt
string
ISO 8601 timestamp of creation

Example Request

curl -X POST https://your-umami-instance.com/api/reports \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "websiteId": "550e8400-e29b-41d4-a716-446655440000",
    "type": "funnel",
    "name": "Checkout Funnel",
    "description": "Track users through checkout",
    "parameters": {
      "startDate": "2024-03-01T00:00:00.000Z",
      "endDate": "2024-03-31T23:59:59.999Z",
      "window": 30,
      "steps": [
        {"type": "path", "value": "/cart"},
        {"type": "path", "value": "/checkout"},
        {"type": "event", "value": "purchase"}
      ]
    }
  }'

Example Response

{
  "id": "dd0e8400-e29b-41d4-a716-446655440008",
  "websiteId": "550e8400-e29b-41d4-a716-446655440000",
  "userId": "660e8400-e29b-41d4-a716-446655440001",
  "type": "funnel",
  "name": "Checkout Funnel",
  "description": "Track users through checkout",
  "parameters": {
    "startDate": "2024-03-01T00:00:00.000Z",
    "endDate": "2024-03-31T23:59:59.999Z",
    "window": 30,
    "steps": [
      {"type": "path", "value": "/cart"},
      {"type": "path", "value": "/checkout"},
      {"type": "event", "value": "purchase"}
    ]
  },
  "createdAt": "2024-03-15T14:30:00.000Z"
}

Error Responses

401
error
Unauthorized - You don’t have permission to create reports for this website
You must have update permissions for the website to create reports.

Build docs developers (and LLMs) love