API Docs

custom-reports

AdminUpdated Sep 19, 2026
GEThttps://api.chatlychat.com/v1/custom-reports
List custom reports visible to the caller
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringnoUUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict.
Responses
200
Code samples
cURL
curl -X GET "https://api.chatlychat.com/v1/custom-reports" \
  -H "Idempotency-Key: <value>"
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/custom-reports', {
  method: 'GET',
  headers: {
    'Idempotency-Key': '<value>',
  },
});
const data = await res.json();
Python
import requests

res = requests.request(
    "GET",
    "https://api.chatlychat.com/v1/custom-reports",
    headers={
    "Idempotency-Key": "<value>",
    },
)
data = res.json()
Go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.chatlychat.com/v1/custom-reports", nil)
	req.Header.Set("Idempotency-Key", "<value>")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/custom-reports');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/custom-reports')
req = Net::HTTP::Get.new(uri)
req['Idempotency-Key'] = '<value>'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
Java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.chatlychat.com/v1/custom-reports"))
    .header("Idempotency-Key", "<value>")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
POSThttps://api.chatlychat.com/v1/custom-reports
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringnoUUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict.
Request body application/json
{
  "name": "string",
  "description": null,
  "definition": {
    "metric": {
      "fn": "count",
      "source": "conversations",
      "field": "string"
    },
    "dimension": "none",
    "filters": {},
    "chartType": "bar",
    "dateRangeDays": 0
  },
  "isShared": false
}
Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/custom-reports" \
  -H "Idempotency-Key: <value>" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","description":null,"definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0},"isShared":false}'
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/custom-reports', {
  method: 'POST',
  headers: {
    'Idempotency-Key': '<value>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"name":"string","description":null,"definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0},"isShared":false}),
});
const data = await res.json();
Python
import requests

res = requests.request(
    "POST",
    "https://api.chatlychat.com/v1/custom-reports",
    headers={
    "Idempotency-Key": "<value>",
    "Content-Type": "application/json",
    },
    json={"name": "string", "description": None, "definition": {"metric": {"fn": "count", "source": "conversations", "field": "string"}, "dimension": "none", "filters": {}, "chartType": "bar", "dateRangeDays": 0}, "isShared": False},
)
data = res.json()
Go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/custom-reports", strings.NewReader(`{"name":"string","description":null,"definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0},"isShared":false}`))
	req.Header.Set("Idempotency-Key", "<value>")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/custom-reports');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name":"string","description":null,"definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0},"isShared":false}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/custom-reports')
req = Net::HTTP::Post.new(uri)
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"name":"string","description":null,"definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0},"isShared":false}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
Java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.chatlychat.com/v1/custom-reports"))
    .header("Idempotency-Key", "<value>")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"name\":\"string\",\"description\":null,\"definition\":{\"metric\":{\"fn\":\"count\",\"source\":\"conversations\",\"field\":\"string\"},\"dimension\":\"none\",\"filters\":{},\"chartType\":\"bar\",\"dateRangeDays\":0},\"isShared\":false}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
GEThttps://api.chatlychat.com/v1/custom-reports/{id}
Parameters
NameInTypeRequiredDescription
idpathstringyes
Idempotency-KeyheaderstringnoUUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict.
Responses
200
Code samples
cURL
curl -X GET "https://api.chatlychat.com/v1/custom-reports/{id}" \
  -H "Idempotency-Key: <value>"
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/custom-reports/{id}', {
  method: 'GET',
  headers: {
    'Idempotency-Key': '<value>',
  },
});
const data = await res.json();
Python
import requests

res = requests.request(
    "GET",
    "https://api.chatlychat.com/v1/custom-reports/{id}",
    headers={
    "Idempotency-Key": "<value>",
    },
)
data = res.json()
Go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.chatlychat.com/v1/custom-reports/{id}", nil)
	req.Header.Set("Idempotency-Key", "<value>")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/custom-reports/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/custom-reports/{id}')
req = Net::HTTP::Get.new(uri)
req['Idempotency-Key'] = '<value>'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
Java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.chatlychat.com/v1/custom-reports/{id}"))
    .header("Idempotency-Key", "<value>")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
DELETEhttps://api.chatlychat.com/v1/custom-reports/{id}
Parameters
NameInTypeRequiredDescription
idpathstringyes
Idempotency-KeyheaderstringnoUUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict.
Responses
200
Code samples
cURL
curl -X DELETE "https://api.chatlychat.com/v1/custom-reports/{id}" \
  -H "Idempotency-Key: <value>"
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/custom-reports/{id}', {
  method: 'DELETE',
  headers: {
    'Idempotency-Key': '<value>',
  },
});
const data = await res.json();
Python
import requests

res = requests.request(
    "DELETE",
    "https://api.chatlychat.com/v1/custom-reports/{id}",
    headers={
    "Idempotency-Key": "<value>",
    },
)
data = res.json()
Go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "https://api.chatlychat.com/v1/custom-reports/{id}", nil)
	req.Header.Set("Idempotency-Key", "<value>")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/custom-reports/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/custom-reports/{id}')
req = Net::HTTP::Delete.new(uri)
req['Idempotency-Key'] = '<value>'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
Java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.chatlychat.com/v1/custom-reports/{id}"))
    .header("Idempotency-Key", "<value>")
    .method("DELETE", BodyPublishers.noBody())
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
PATCHhttps://api.chatlychat.com/v1/custom-reports/{id}
Parameters
NameInTypeRequiredDescription
idpathstringyes
Idempotency-KeyheaderstringnoUUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict.
Request body application/json
{
  "name": "string",
  "description": "string",
  "definition": {
    "metric": {
      "fn": "count",
      "source": "conversations",
      "field": "string"
    },
    "dimension": "none",
    "filters": {},
    "chartType": "bar",
    "dateRangeDays": 0
  },
  "isShared": true
}
Responses
200
Code samples
cURL
curl -X PATCH "https://api.chatlychat.com/v1/custom-reports/{id}" \
  -H "Idempotency-Key: <value>" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","description":"string","definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0},"isShared":true}'
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/custom-reports/{id}', {
  method: 'PATCH',
  headers: {
    'Idempotency-Key': '<value>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"name":"string","description":"string","definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0},"isShared":true}),
});
const data = await res.json();
Python
import requests

res = requests.request(
    "PATCH",
    "https://api.chatlychat.com/v1/custom-reports/{id}",
    headers={
    "Idempotency-Key": "<value>",
    "Content-Type": "application/json",
    },
    json={"name": "string", "description": "string", "definition": {"metric": {"fn": "count", "source": "conversations", "field": "string"}, "dimension": "none", "filters": {}, "chartType": "bar", "dateRangeDays": 0}, "isShared": True},
)
data = res.json()
Go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("PATCH", "https://api.chatlychat.com/v1/custom-reports/{id}", strings.NewReader(`{"name":"string","description":"string","definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0},"isShared":true}`))
	req.Header.Set("Idempotency-Key", "<value>")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/custom-reports/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name":"string","description":"string","definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0},"isShared":true}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/custom-reports/{id}')
req = Net::HTTP::Patch.new(uri)
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"name":"string","description":"string","definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0},"isShared":true}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
Java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.chatlychat.com/v1/custom-reports/{id}"))
    .header("Idempotency-Key", "<value>")
    .header("Content-Type", "application/json")
    .method("PATCH", BodyPublishers.ofString("{\"name\":\"string\",\"description\":\"string\",\"definition\":{\"metric\":{\"fn\":\"count\",\"source\":\"conversations\",\"field\":\"string\"},\"dimension\":\"none\",\"filters\":{},\"chartType\":\"bar\",\"dateRangeDays\":0},\"isShared\":true}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
POSThttps://api.chatlychat.com/v1/custom-reports/{id}/run
Execute a saved report and return chart-ready data
Parameters
NameInTypeRequiredDescription
idpathstringyes
Idempotency-KeyheaderstringnoUUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict.
Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/custom-reports/{id}/run" \
  -H "Idempotency-Key: <value>"
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/custom-reports/{id}/run', {
  method: 'POST',
  headers: {
    'Idempotency-Key': '<value>',
  },
});
const data = await res.json();
Python
import requests

res = requests.request(
    "POST",
    "https://api.chatlychat.com/v1/custom-reports/{id}/run",
    headers={
    "Idempotency-Key": "<value>",
    },
)
data = res.json()
Go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/custom-reports/{id}/run", nil)
	req.Header.Set("Idempotency-Key", "<value>")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/custom-reports/{id}/run');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/custom-reports/{id}/run')
req = Net::HTTP::Post.new(uri)
req['Idempotency-Key'] = '<value>'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
Java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.chatlychat.com/v1/custom-reports/{id}/run"))
    .header("Idempotency-Key", "<value>")
    .method("POST", BodyPublishers.noBody())
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
POSThttps://api.chatlychat.com/v1/custom-reports/run
Run an ad-hoc report definition (used by the live preview)
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringnoUUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict.
Request body application/json
{
  "definition": {
    "metric": {
      "fn": "count",
      "source": "conversations",
      "field": "string"
    },
    "dimension": "none",
    "filters": {},
    "chartType": "bar",
    "dateRangeDays": 0
  }
}
Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/custom-reports/run" \
  -H "Idempotency-Key: <value>" \
  -H "Content-Type: application/json" \
  -d '{"definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0}}'
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/custom-reports/run', {
  method: 'POST',
  headers: {
    'Idempotency-Key': '<value>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0}}),
});
const data = await res.json();
Python
import requests

res = requests.request(
    "POST",
    "https://api.chatlychat.com/v1/custom-reports/run",
    headers={
    "Idempotency-Key": "<value>",
    "Content-Type": "application/json",
    },
    json={"definition": {"metric": {"fn": "count", "source": "conversations", "field": "string"}, "dimension": "none", "filters": {}, "chartType": "bar", "dateRangeDays": 0}},
)
data = res.json()
Go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/custom-reports/run", strings.NewReader(`{"definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0}}`))
	req.Header.Set("Idempotency-Key", "<value>")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/custom-reports/run');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0}}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/custom-reports/run')
req = Net::HTTP::Post.new(uri)
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"definition":{"metric":{"fn":"count","source":"conversations","field":"string"},"dimension":"none","filters":{},"chartType":"bar","dateRangeDays":0}}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
Java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.chatlychat.com/v1/custom-reports/run"))
    .header("Idempotency-Key", "<value>")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"definition\":{\"metric\":{\"fn\":\"count\",\"source\":\"conversations\",\"field\":\"string\"},\"dimension\":\"none\",\"filters\":{},\"chartType\":\"bar\",\"dateRangeDays\":0}}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Was this page helpful?
custom-reports