Create a report template
POST
/api/v1/reports/templates
const url = 'https://api.ultimateteam.ai/api/v1/reports/templates';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"delivery_email":"example","description":"example","filters":{},"groupings":["example"],"metric_ids":["example"],"name":"example","output_format":"json","schedule":"example","shared_with_tenant":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ultimateteam.ai/api/v1/reports/templates \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "delivery_email": "example", "description": "example", "filters": {}, "groupings": [ "example" ], "metric_ids": [ "example" ], "name": "example", "output_format": "json", "schedule": "example", "shared_with_tenant": false }'Create a new custom report template scoped to the caller’s tenant. Metric IDs are validated against the catalog.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
ReportTemplateCreate
Schema for creating a new report template.
Attributes: name: Template name (max 120 chars). description: Optional description. metric_ids: Non-empty list of metric_id strings. filters: Optional dict of filter key-value pairs. groupings: Optional list of grouping columns. schedule: Optional cron expression. output_format: One of json, pdf, csv. delivery_email: Optional email for delivery. shared_with_tenant: Whether to share with all tenant users.
object
filters
Filters
object
key
additional properties
any
groupings
Groupings
Array<string>
metric_ids
required
Metric Ids
Array<string>
name
required
Name
string
output_format
Output Format
string
shared_with_tenant
Shared With Tenant
boolean
Responses
Section titled “ Responses ”Successful Response
Media typeapplication/json
Response Create Report Template Api V1 Reports Templates Post
object
key
additional properties
any
Examplegenerated
{}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}