Skip to content

Get a report definition

GET
/api/v1/{bucket}/reports/{report_id}

Returns the full definition of a report including its SQL template and parameter specifications.

bucket
required
string
/^[a-zA-Z0-9][a-zA-Z0-9\-]*$/

Flock bucket ID. The caller must have access to this bucket.

Example
example
report_id
required
string

Report identifier.

Example
age_summary

Full report definition

object
data
required
object
id
required
string
Example
age_summary
name
required
string
Example
Age Summary
description
required
string
Example
Counts people by age band. Excludes deceased.
category
required
string
Allowed values: people membership finance fundraising
Example
people
tags
required
Array<string>
Example
[
"age",
"demographics"
]
parameters
required
Array<object>
object
name
required
string
Example
start_date
type
required
string
Allowed values: date integer enum
Example
date
required
required
boolean
Example
true
description
required
string
Example
Start date (inclusive, YYYY-MM-DD).
options

Valid values for enum-type parameters.

Array<string>
min

Minimum value for integer parameters.

integer
max

Maximum value for integer parameters.

integer
sql
required

SQL template with named parameter placeholders.

string

Authentication required

object
error
required
object
code
required

Machine-readable error code.

string
Example
unauthorized
message
required

Human-readable error message.

string
Example
Authentication required
Example
{
"error": {
"code": "unauthorized",
"message": "Authentication required"
}
}

Access denied to bucket

object
error
required
object
code
required

Machine-readable error code.

string
Example
unauthorized
message
required

Human-readable error message.

string
Example
Authentication required
Example
{
"error": {
"code": "forbidden",
"message": "Access denied to bucket 'example'"
}
}

Resource not found

object
error
required
object
code
required

Machine-readable error code.

string
Example
unauthorized
message
required

Human-readable error message.

string
Example
Authentication required
Example
{
"error": {
"code": "not_found",
"message": "Unknown table: foo"
}
}