Attach a Data query to a report
curl --request POST \
--url https://app.chatobserver.com/api/v2/reports/{reportId}/data-sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"stableKey": "<string>",
"displayName": "<string>",
"queryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queryVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
stableKey: '<string>',
displayName: '<string>',
queryId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
queryVersionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.chatobserver.com/api/v2/reports/{reportId}/data-sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.chatobserver.com/api/v2/reports/{reportId}/data-sources"
payload = {
"stableKey": "<string>",
"displayName": "<string>",
"queryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queryVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"attachmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reportId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stableKey": "<string>",
"displayName": "<string>",
"attachmentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"catalogue": {
"version": 1,
"attachmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": {
"kind": "metrics_query",
"connectorKey": "<string>",
"sourceAccountIds": [
123
],
"catalogueSnapshotIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"fields": [
{
"id": "<string>",
"sourceFieldId": "<string>",
"displayName": "<string>",
"description": "<string>",
"role": "dimension",
"dataType": "string",
"defaultAggregation": "none",
"allowedAggregations": [
"<unknown>"
],
"format": {
"kind": "number",
"locale": "<string>",
"currencyCode": "<string>",
"minimumFractionDigits": 10,
"maximumFractionDigits": 10,
"compact": true,
"dateStyle": "short",
"timeStyle": "short"
},
"semanticTags": [
"<string>"
],
"nullable": true,
"hidden": true,
"sensitive": true,
"filter": {
"allowed": true,
"operators": [
"<string>"
],
"valueResolverId": "<string>"
},
"orderable": true,
"lineage": {
"kind": "metrics",
"connectorKey": "<string>",
"sourceAccountId": 123,
"catalogueSnapshotId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceFieldId": "<string>",
"providerFieldId": "<string>",
"origin": "<string>"
}
}
],
"generatedAt": "2023-11-07T05:31:56Z",
"schemaFingerprint": "<string>"
},
"generation": {
"status": "<string>",
"freshness": "<string>",
"rowCount": 1,
"warnings": [
"<string>"
]
}
},
"adoption": {
"state": "complete",
"issueCode": "<string>",
"generationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}Reports
Attach a Data query to a report
Create a native report-owned reference to a readable published Metrics V2 query/version. Delegated OAuth only; reports:write, data:read, native report edit and current query/connection/network access are required. Returns immutable attachment and semantic catalogue identities. UUID retries preserve the native request. No provider execution, saved report edit or publication.
POST
/
api
/
v2
/
reports
/
{reportId}
/
data-sources
Attach a Data query to a report
curl --request POST \
--url https://app.chatobserver.com/api/v2/reports/{reportId}/data-sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"stableKey": "<string>",
"displayName": "<string>",
"queryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queryVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
stableKey: '<string>',
displayName: '<string>',
queryId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
queryVersionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.chatobserver.com/api/v2/reports/{reportId}/data-sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.chatobserver.com/api/v2/reports/{reportId}/data-sources"
payload = {
"stableKey": "<string>",
"displayName": "<string>",
"queryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"queryVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"attachmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reportId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stableKey": "<string>",
"displayName": "<string>",
"attachmentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"catalogue": {
"version": 1,
"attachmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": {
"kind": "metrics_query",
"connectorKey": "<string>",
"sourceAccountIds": [
123
],
"catalogueSnapshotIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"fields": [
{
"id": "<string>",
"sourceFieldId": "<string>",
"displayName": "<string>",
"description": "<string>",
"role": "dimension",
"dataType": "string",
"defaultAggregation": "none",
"allowedAggregations": [
"<unknown>"
],
"format": {
"kind": "number",
"locale": "<string>",
"currencyCode": "<string>",
"minimumFractionDigits": 10,
"maximumFractionDigits": 10,
"compact": true,
"dateStyle": "short",
"timeStyle": "short"
},
"semanticTags": [
"<string>"
],
"nullable": true,
"hidden": true,
"sensitive": true,
"filter": {
"allowed": true,
"operators": [
"<string>"
],
"valueResolverId": "<string>"
},
"orderable": true,
"lineage": {
"kind": "metrics",
"connectorKey": "<string>",
"sourceAccountId": 123,
"catalogueSnapshotId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceFieldId": "<string>",
"providerFieldId": "<string>",
"origin": "<string>"
}
}
],
"generatedAt": "2023-11-07T05:31:56Z",
"schemaFingerprint": "<string>"
},
"generation": {
"status": "<string>",
"freshness": "<string>",
"rowCount": 1,
"warnings": [
"<string>"
]
}
},
"adoption": {
"state": "complete",
"issueCode": "<string>",
"generationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"requestId": "<string>"
}Required scopes:
reports:write, data:read.Authorizations
Delegated application credential issued after Chatobserver account consent. Restricted to selected workspaces and explicitly supported MCP operations. The MCP server access token is a separate credential and cannot be used here.
Headers
Explicit workspace selected for the delegated account.
Pattern:
^ws_[a-f0-9]{32}$Path Parameters
Body
application/json