Create an analysis view
curl --request POST \
--url https://app.chatobserver.com/api/v2/metrics/analysis-views \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-chatobserver-key: <api-key>' \
--data '
{
"name": "<string>",
"definition": {
"schemaVersion": 1,
"source": {
"kind": "query",
"queryVersionId": "<string>",
"queryId": "<string>"
},
"fields": [
{
"label": "<string>",
"fieldId": "<string>"
}
],
"filters": [
{
"values": [
"<string>"
],
"fieldId": "<string>"
}
],
"comparison": {
"baselineRunId": "<string>"
},
"presentation": {
"description": "<string>",
"title": "<string>",
"showLegend": false,
"showLabels": false
},
"refresh": {
"artifactId": "<string>"
}
},
"description": "<string>",
"visibility": "workspace",
"publish": false
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-chatobserver-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
definition: {
schemaVersion: 1,
source: {kind: 'query', queryVersionId: '<string>', queryId: '<string>'},
fields: [{label: '<string>', fieldId: '<string>'}],
filters: [{values: ['<string>'], fieldId: '<string>'}],
comparison: {baselineRunId: '<string>'},
presentation: {
description: '<string>',
title: '<string>',
showLegend: false,
showLabels: false
},
refresh: {artifactId: '<string>'}
},
description: '<string>',
visibility: 'workspace',
publish: false
})
};
fetch('https://app.chatobserver.com/api/v2/metrics/analysis-views', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.chatobserver.com/api/v2/metrics/analysis-views"
payload = {
"name": "<string>",
"definition": {
"schemaVersion": 1,
"source": {
"kind": "query",
"queryVersionId": "<string>",
"queryId": "<string>"
},
"fields": [
{
"label": "<string>",
"fieldId": "<string>"
}
],
"filters": [
{
"values": ["<string>"],
"fieldId": "<string>"
}
],
"comparison": { "baselineRunId": "<string>" },
"presentation": {
"description": "<string>",
"title": "<string>",
"showLegend": False,
"showLabels": False
},
"refresh": { "artifactId": "<string>" }
},
"description": "<string>",
"visibility": "workspace",
"publish": False
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-chatobserver-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"actorId": "<string>",
"analysisViewId": "<string>",
"versionId": "<string>",
"versionNumber": 123,
"versionStatus": "draft",
"canonicalHash": "<string>"
},
"replayed": false
}{
"data": {
"actorId": "<string>",
"analysisViewId": "<string>",
"versionId": "<string>",
"versionNumber": 123,
"versionStatus": "draft",
"canonicalHash": "<string>"
},
"replayed": false
}{
"error": {
"code": "internal",
"fieldPath": [
"<string>"
],
"parameters": {},
"repairActions": [
"<string>"
],
"requestId": "<string>",
"retryable": false,
"retryAfterSeconds": 1
}
}Data definitions
Create an analysis view
Manage reusable definitions and their immutable versions.
POST
/
api
/
v2
/
metrics
/
analysis-views
Create an analysis view
curl --request POST \
--url https://app.chatobserver.com/api/v2/metrics/analysis-views \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-chatobserver-key: <api-key>' \
--data '
{
"name": "<string>",
"definition": {
"schemaVersion": 1,
"source": {
"kind": "query",
"queryVersionId": "<string>",
"queryId": "<string>"
},
"fields": [
{
"label": "<string>",
"fieldId": "<string>"
}
],
"filters": [
{
"values": [
"<string>"
],
"fieldId": "<string>"
}
],
"comparison": {
"baselineRunId": "<string>"
},
"presentation": {
"description": "<string>",
"title": "<string>",
"showLegend": false,
"showLabels": false
},
"refresh": {
"artifactId": "<string>"
}
},
"description": "<string>",
"visibility": "workspace",
"publish": false
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-chatobserver-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
definition: {
schemaVersion: 1,
source: {kind: 'query', queryVersionId: '<string>', queryId: '<string>'},
fields: [{label: '<string>', fieldId: '<string>'}],
filters: [{values: ['<string>'], fieldId: '<string>'}],
comparison: {baselineRunId: '<string>'},
presentation: {
description: '<string>',
title: '<string>',
showLegend: false,
showLabels: false
},
refresh: {artifactId: '<string>'}
},
description: '<string>',
visibility: 'workspace',
publish: false
})
};
fetch('https://app.chatobserver.com/api/v2/metrics/analysis-views', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.chatobserver.com/api/v2/metrics/analysis-views"
payload = {
"name": "<string>",
"definition": {
"schemaVersion": 1,
"source": {
"kind": "query",
"queryVersionId": "<string>",
"queryId": "<string>"
},
"fields": [
{
"label": "<string>",
"fieldId": "<string>"
}
],
"filters": [
{
"values": ["<string>"],
"fieldId": "<string>"
}
],
"comparison": { "baselineRunId": "<string>" },
"presentation": {
"description": "<string>",
"title": "<string>",
"showLegend": False,
"showLabels": False
},
"refresh": { "artifactId": "<string>" }
},
"description": "<string>",
"visibility": "workspace",
"publish": False
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-chatobserver-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"actorId": "<string>",
"analysisViewId": "<string>",
"versionId": "<string>",
"versionNumber": 123,
"versionStatus": "draft",
"canonicalHash": "<string>"
},
"replayed": false
}{
"data": {
"actorId": "<string>",
"analysisViewId": "<string>",
"versionId": "<string>",
"versionNumber": 123,
"versionStatus": "draft",
"canonicalHash": "<string>"
},
"replayed": false
}{
"error": {
"code": "internal",
"fieldPath": [
"<string>"
],
"parameters": {},
"repairActions": [
"<string>"
],
"requestId": "<string>",
"retryable": false,
"retryAfterSeconds": 1
}
}Required scopes:
metrics:write.Authorizations
WorkspaceKeyBearerKey
A workspace API key. Data endpoints require a service-account key with the specified scopes.
Headers
Unique key for one logical command. Reuse it only when retrying the same request and payload.
Required string length:
16 - 160Pattern:
^[A-Za-z0-9:_-]+$Body
application/json
Required string length:
1 - 150Show child attributes
Show child attributes
Maximum string length:
4000Service-account resources must be visible to the workspace.
Allowed value:
"workspace"