Update a report
curl --request PATCH \
--url https://clarus-api.com/api/reports/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "reports",
"attributes": {
"description": "<string>",
"name": "<string>",
"report_fields": [
{
"name": "<string>",
"path": "<string>",
"prefix": "<string>",
"suffix": "<string>"
}
],
"report_query_id": 123,
"source_path": "<string>",
"variables": [
{
"name": "<string>",
"value": "<string>",
"prompt": "<string>",
"operator": "<string>"
}
]
}
}
}
'import requests
url = "https://clarus-api.com/api/reports/{id}"
payload = { "data": {
"type": "reports",
"attributes": {
"description": "<string>",
"name": "<string>",
"report_fields": [
{
"name": "<string>",
"path": "<string>",
"prefix": "<string>",
"suffix": "<string>"
}
],
"report_query_id": 123,
"source_path": "<string>",
"variables": [
{
"name": "<string>",
"value": "<string>",
"prompt": "<string>",
"operator": "<string>"
}
]
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'reports',
attributes: {
description: '<string>',
name: '<string>',
report_fields: [{name: '<string>', path: '<string>', prefix: '<string>', suffix: '<string>'}],
report_query_id: 123,
source_path: '<string>',
variables: [
{name: '<string>', value: '<string>', prompt: '<string>', operator: '<string>'}
]
}
}
})
};
fetch('https://clarus-api.com/api/reports/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "reports",
"attributes": {
"name": "Count of Tasks Left To Do",
"description": "Count of Tasks Left To Do by Task Type",
"report_type": "bar",
"report_query_id": 1,
"source_path": "data.tasks.aggregation",
"report_fields": [
{
"name": "Task Type",
"path": "task_type.code"
},
{
"name": "Tasks Left To Do",
"path": "total_records"
}
],
"variables": [
{
"name": "created_at_from",
"value": "start of today",
"prompt": "true"
},
{
"name": "created_at_to",
"value": "end of today",
"prompt": "true"
}
]
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Reports
Update a report
Update an existing report’s attributes. Only the report owner can update it.
PATCH
/
api
/
reports
/
{id}
Update a report
curl --request PATCH \
--url https://clarus-api.com/api/reports/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "reports",
"attributes": {
"description": "<string>",
"name": "<string>",
"report_fields": [
{
"name": "<string>",
"path": "<string>",
"prefix": "<string>",
"suffix": "<string>"
}
],
"report_query_id": 123,
"source_path": "<string>",
"variables": [
{
"name": "<string>",
"value": "<string>",
"prompt": "<string>",
"operator": "<string>"
}
]
}
}
}
'import requests
url = "https://clarus-api.com/api/reports/{id}"
payload = { "data": {
"type": "reports",
"attributes": {
"description": "<string>",
"name": "<string>",
"report_fields": [
{
"name": "<string>",
"path": "<string>",
"prefix": "<string>",
"suffix": "<string>"
}
],
"report_query_id": 123,
"source_path": "<string>",
"variables": [
{
"name": "<string>",
"value": "<string>",
"prompt": "<string>",
"operator": "<string>"
}
]
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'reports',
attributes: {
description: '<string>',
name: '<string>',
report_fields: [{name: '<string>', path: '<string>', prefix: '<string>', suffix: '<string>'}],
report_query_id: 123,
source_path: '<string>',
variables: [
{name: '<string>', value: '<string>', prompt: '<string>', operator: '<string>'}
]
}
}
})
};
fetch('https://clarus-api.com/api/reports/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "reports",
"attributes": {
"name": "Count of Tasks Left To Do",
"description": "Count of Tasks Left To Do by Task Type",
"report_type": "bar",
"report_query_id": 1,
"source_path": "data.tasks.aggregation",
"report_fields": [
{
"name": "Task Type",
"path": "task_type.code"
},
{
"name": "Tasks Left To Do",
"path": "total_records"
}
],
"variables": [
{
"name": "created_at_from",
"value": "start of today",
"prompt": "true"
},
{
"name": "created_at_to",
"value": "end of today",
"prompt": "true"
}
]
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "reports",
"attributes": {
"name": "Updated Stock Report",
"description": "Updated description",
"variables": [
{ "name": "date_from", "value": "beginning of month", "prompt": "Date From", "operator": ">=" }
]
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
name | No | Updated report name |
description | No | Updated description |
report_type | No | Updated output type |
report_fields | No | Updated field definitions |
variables | No | Updated variable values |
Access Control
Only the report owner can update it. Returns 403 if the authenticated user is not the owner.Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The unique identifier of the report to update
Body
application/json
Show child attributes
Show child attributes
Response
Report updated successfully
Show child attributes
Show child attributes
⌘I

