ChatKomodo Docs Home Sign in

API reference · Customers

Privacy

Export or erase everything held about one person, and how long message content is kept.

Export the data of one person

GET/v1/privacy/contact

Export everything held about one person (data-subject access request): consent and its history, contacts, messages (up to 5 000, plus up to 5 000 from the message archive), inbox, assignments, blast participation, scheduled and recurring messages, satisfaction answers. Account owner or API key only.

Query parameters

  • phonestringrequired
    International format +<country code><number>

Responses

  • 200Everything held for that number
    Response fields
    • exported_atstringrequired
    • phonestringrequired
    • consentany
    • consent_historyarray of anyrequired
    • contactsarray of anyrequired
    • messagesarray of anyrequired
    • messages_truncatedbooleanrequired
    • archived_messagesarray of any
      Messages of this person in the message archive (up to 5 000)
    • inboxarray of anyrequired
    • chat_metadataarray of anyrequired
    • assignmentsarray of anyrequired
    • blast_participationarray of anyrequired
    • scheduled_messagesarray of anyrequired
    • recurring_messagesarray of anyrequired
    • csat_responsesarray of anyrequired
    • lead_notesarray of anyrequired
    • label_historyarray of anyrequired
    • link_clicksarray of anyrequired
      Visits through your click-to-WhatsApp links that led to a chat with this person
    • invoicesarray of anyrequired
      QRIS invoices sent to this person (on erasure they are kept without the number)
  • 400INVALID_NUMBER
Request
curl "https://api.chatkomodo.com/v1/privacy/contact?phone=%2B447700900123" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/privacy/contact?phone=%2B447700900123', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.get(
    "https://api.chatkomodo.com/v1/privacy/contact?phone=%2B447700900123",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/privacy/contact?phone=%2B447700900123', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/privacy/contact?phone=%2B447700900123", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200
{
  "exported_at": "string",
  "phone": "+447700900123",
  "consent": "string",
  "consent_history": [
    "string"
  ],
  "contacts": [
    "string"
  ],
  "messages": [
    "Hi Sam, your order has shipped."
  ],
  "messages_truncated": true,
  "archived_messages": [
    "Hi Sam, your order has shipped."
  ],
  "inbox": [
    "string"
  ],
  "chat_metadata": [
    "string"
  ],
  "assignments": [
    "string"
  ],
  "blast_participation": [
    "string"
  ],
  "scheduled_messages": [
    "Hi Sam, your order has shipped."
  ],
  "recurring_messages": [
    "Hi Sam, your order has shipped."
  ],
  "csat_responses": [
    "string"
  ],
  "lead_notes": [
    "Prefers delivery after 5 pm"
  ],
  "label_history": [
    "string"
  ],
  "link_clicks": [
    "https://example.com/file.jpg"
  ]
}

Erase the data of one person

DEL/v1/privacy/contact

Erase everything held about one person (right to erasure), including the message archive. Irreversible. confirm must repeat the phone number, otherwise the call fails with 400 CONFIRMATION_REQUIRED. By default an opt-out record is kept so the person is not messaged again (keep_suppression: false removes it too). Account owner or API key only.

Request body

  • phonestringrequired
  • confirmstringrequired
    The same phone number again
  • keep_suppressionboolean
    Default true

Responses

  • 200Erased
    Response fields
    • okbooleanrequired
    • deletedobjectrequired
      Rows removed per data type
    • suppression_keptbooleanrequired
    • failedarray of stringrequired
      Data types that could not be erased; empty when the erasure is complete
  • 400INVALID_NUMBER or CONFIRMATION_REQUIRED
  • 500ERASURE_INCOMPLETE: some records could not be deleted (failed lists them); repeat the request or contact support
Request
curl -X DELETE "https://api.chatkomodo.com/v1/privacy/contact" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "+447700900123",
  "confirm": "+447700900123",
  "keep_suppression": true
}'
const res = await fetch('https://api.chatkomodo.com/v1/privacy/contact', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "phone": "+447700900123",
    "confirm": "+447700900123",
    "keep_suppression": true
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.delete(
    "https://api.chatkomodo.com/v1/privacy/contact",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    json={
        "phone": "+447700900123",
        "confirm": "+447700900123",
        "keep_suppression": True,
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('DELETE', 'https://api.chatkomodo.com/v1/privacy/contact', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
    'json' => [
        'phone' => '+447700900123',
        'confirm' => '+447700900123',
        'keep_suppression' => true,
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	body := strings.NewReader(`{
	  "phone": "+447700900123",
	  "confirm": "+447700900123",
	  "keep_suppression": true
	}`)
	req, err := http.NewRequest("DELETE", "https://api.chatkomodo.com/v1/privacy/contact", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200
{
  "ok": true,
  "deleted": {},
  "suppression_kept": true,
  "failed": [
    "string"
  ]
}

Get the message retention

GET/v1/privacy/retention

How long message content is kept.

Responses

  • 200Retention
    Response fields
    • message_daysinteger | nullrequired
      Your own setting; null = platform default
    • effective_daysintegerrequired
    • default_daysintegerrequired
    • min_daysintegerrequired
    • max_daysintegerrequired
Request
curl "https://api.chatkomodo.com/v1/privacy/retention" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/privacy/retention', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.get(
    "https://api.chatkomodo.com/v1/privacy/retention",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/privacy/retention', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/privacy/retention", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200
{
  "message_days": 1,
  "effective_days": 1,
  "default_days": 1,
  "min_days": 1,
  "max_days": 1
}

Set the message retention

PUT/v1/privacy/retention

Set the message retention period in days (between min_days and max_days), or null for the platform default. Account owner only.

Request body

  • message_daysinteger | nullrequired

Responses

  • 200Saved
    Response fields
    • message_daysinteger | nullrequired
    • effective_daysintegerrequired
  • 400Out of range (VALIDATION_FAILED)
Request
curl -X PUT "https://api.chatkomodo.com/v1/privacy/retention" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "message_days": 90
}'
const res = await fetch('https://api.chatkomodo.com/v1/privacy/retention', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "message_days": 90
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.put(
    "https://api.chatkomodo.com/v1/privacy/retention",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    json={
        "message_days": 90,
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('PUT', 'https://api.chatkomodo.com/v1/privacy/retention', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
    'json' => [
        'message_days' => 90,
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	body := strings.NewReader(`{
	  "message_days": 90
	}`)
	req, err := http.NewRequest("PUT", "https://api.chatkomodo.com/v1/privacy/retention", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200
{
  "message_days": 1,
  "effective_days": 1
}

Get the message archive

GET/v1/privacy/archive

The message archive: when it is on, messages past the retention period are moved out of the database into encrypted monthly files instead of being deleted, and kept for keep_days. Lists the archived months. Account owner or API key only.

Responses

  • 200Archive
    Response fields
    • enabledbooleanrequired
    • keep_daysintegerrequired
    • keep_minintegerrequired
    • keep_maxintegerrequired
    • monthsarray of objectrequired
    • months[].monthstringrequired
      YYYY-MM (UTC)
    • months[].messagesintegerrequired
    • months[].bytesintegerrequired
      Compressed size on disk
    • months[].filesintegerrequired
Request
curl "https://api.chatkomodo.com/v1/privacy/archive" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/privacy/archive', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.get(
    "https://api.chatkomodo.com/v1/privacy/archive",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/privacy/archive', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/privacy/archive", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200
{
  "enabled": true,
  "keep_days": 1,
  "keep_min": 1,
  "keep_max": 1,
  "months": [
    {
      "month": "string",
      "messages": 1,
      "bytes": 1,
      "files": 12
    }
  ]
}

Set up the message archive

PUT/v1/privacy/archive

Switch the archive on or off and choose how long archived months are kept (30-1 825 days after the month ends). Switching it off keeps what is already archived until its keep period ends; delete months to remove them sooner. Account owner only. Recorded as privacy.archive.

Request body

  • enabledboolean
  • keep_daysinteger
    From 30 to 1 825

Responses

  • 200Saved
    Response fields
    • enabledbooleanrequired
    • keep_daysintegerrequired
    • keep_minintegerrequired
    • keep_maxintegerrequired
    • monthsarray of objectrequired
    • months[].monthstringrequired
      YYYY-MM (UTC)
    • months[].messagesintegerrequired
    • months[].bytesintegerrequired
      Compressed size on disk
    • months[].filesintegerrequired
  • 400VALIDATION_FAILED
Request
curl -X PUT "https://api.chatkomodo.com/v1/privacy/archive" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": true,
  "keep_days": 30
}'
const res = await fetch('https://api.chatkomodo.com/v1/privacy/archive', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "enabled": true,
    "keep_days": 30
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.put(
    "https://api.chatkomodo.com/v1/privacy/archive",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    json={
        "enabled": True,
        "keep_days": 30,
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('PUT', 'https://api.chatkomodo.com/v1/privacy/archive', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
    'json' => [
        'enabled' => true,
        'keep_days' => 30,
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	body := strings.NewReader(`{
	  "enabled": true,
	  "keep_days": 30
	}`)
	req, err := http.NewRequest("PUT", "https://api.chatkomodo.com/v1/privacy/archive", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200
{
  "enabled": true,
  "keep_days": 1,
  "keep_min": 1,
  "keep_max": 1,
  "months": [
    {
      "month": "string",
      "messages": 1,
      "bytes": 1,
      "files": 12
    }
  ]
}

Download an archived month

GET/v1/privacy/archive/{month}

Download one archived month, oldest message first: JSON lines (default, one message per line with every stored field) or CSV (format=csv; created_at, direction, device, chat, phone, type, text, status, error, sent_at, ids). Recorded as privacy.archive_download.

Path parameters

  • monthstringrequired

Query parameters

  • formatstring
    One of: jsonl, csv

Responses

  • 200The messages (application/x-ndjson or text/csv, as an attachment)
  • 404No archive for that month
Request
curl "https://api.chatkomodo.com/v1/privacy/archive/MONTH" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/privacy/archive/MONTH', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.get(
    "https://api.chatkomodo.com/v1/privacy/archive/MONTH",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/privacy/archive/MONTH', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/privacy/archive/MONTH", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200

application/x-ndjson, text/csv — the file itself.

Delete an archived month

DEL/v1/privacy/archive/{month}

Delete one archived month for good. Account owner only. Recorded as privacy.archive_delete.

Path parameters

  • monthstringrequired

Responses

  • 200Deleted
    Response fields
    • okbooleanrequired
  • 404No archive for that month
Request
curl -X DELETE "https://api.chatkomodo.com/v1/privacy/archive/MONTH" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/privacy/archive/MONTH', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.delete(
    "https://api.chatkomodo.com/v1/privacy/archive/MONTH",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('DELETE', 'https://api.chatkomodo.com/v1/privacy/archive/MONTH', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	req, err := http.NewRequest("DELETE", "https://api.chatkomodo.com/v1/privacy/archive/MONTH", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200
{
  "ok": true
}

Export all business data

GET/v1/account/export

Download every record of your business as NDJSON: a header line, then one {"table", "row"} per line (contacts, chats, messages, labels, leads, links, invoices, settings…). Secrets such as key hashes, tokens and encrypted credentials are left out. Account owner only; 3 per hour.

Responses

  • 200NDJSON file (Content-Disposition: attachment)
  • 403Not the account owner
  • 429Rate limited
Request
curl "https://api.chatkomodo.com/v1/account/export" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/account/export', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.get(
    "https://api.chatkomodo.com/v1/account/export",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/account/export', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/account/export", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200

application/x-ndjson — the file itself.

Get the account deletion status

GET/v1/account/deletion

Whether the deletion of this business is scheduled. Account owner only.

Responses

  • 200Status
    Response fields
    • scheduledobject | nullrequired
    • scheduled.requested_atintegerrequired
    • scheduled.due_atintegerrequired
      When the business and all its data are deleted (ms)
Request
curl "https://api.chatkomodo.com/v1/account/deletion" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/account/deletion', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.get(
    "https://api.chatkomodo.com/v1/account/deletion",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.chatkomodo.com/v1/account/deletion', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	req, err := http.NewRequest("GET", "https://api.chatkomodo.com/v1/account/deletion", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200
{
  "scheduled": {
    "requested_at": 1767225600000,
    "due_at": 1767225600000
  }
}

Schedule account deletion

POST/v1/account/deletion

Schedule the deletion of this business and all its data after a 7-day grace period. confirm must be the business name. Cancel with DELETE before the date. Not available to an agency's client (MANAGED_BY_AGENCY) or to an agency that still has clients (HAS_CLIENTS). Account owner only.

Request body

  • confirmstringrequired
    The business name, typed exactly

Responses

  • 200Scheduled
    Response fields
    • scheduledobject | nullrequired
    • scheduled.requested_atintegerrequired
    • scheduled.due_atintegerrequired
      When the business and all its data are deleted (ms)
  • 400Name does not match
  • 409Managed by an agency, or has clients
Request
curl -X POST "https://api.chatkomodo.com/v1/account/deletion" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "confirm": "string"
}'
const res = await fetch('https://api.chatkomodo.com/v1/account/deletion', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "confirm": "string"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.post(
    "https://api.chatkomodo.com/v1/account/deletion",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    json={
        "confirm": "string",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('POST', 'https://api.chatkomodo.com/v1/account/deletion', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
    'json' => [
        'confirm' => 'string',
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	body := strings.NewReader(`{
	  "confirm": "string"
	}`)
	req, err := http.NewRequest("POST", "https://api.chatkomodo.com/v1/account/deletion", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200
{
  "scheduled": {
    "requested_at": 1767225600000,
    "due_at": 1767225600000
  }
}

Cancel account deletion

DEL/v1/account/deletion

Cancel a scheduled deletion. Account owner only.

Responses

  • 200Cancelled
    Response fields
    • scheduledobject | nullrequired
    • scheduled.requested_atintegerrequired
    • scheduled.due_atintegerrequired
      When the business and all its data are deleted (ms)
Request
curl -X DELETE "https://api.chatkomodo.com/v1/account/deletion" \
  -H "Authorization: Bearer $CHATKOMODO_API_KEY"
const res = await fetch('https://api.chatkomodo.com/v1/account/deletion', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.CHATKOMODO_API_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);
console.log(data);
import os
import requests

res = requests.delete(
    "https://api.chatkomodo.com/v1/account/deletion",
    headers={
        "Authorization": f"Bearer {os.environ['CHATKOMODO_API_KEY']}",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();
$res = $client->request('DELETE', 'https://api.chatkomodo.com/v1/account/deletion', [
    'headers' => [
        'Authorization' => 'Bearer ' . getenv('CHATKOMODO_API_KEY'),
    ],
]);

print_r(json_decode((string) $res->getBody(), true));
package main

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

func main() {
	req, err := http.NewRequest("DELETE", "https://api.chatkomodo.com/v1/account/deletion", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CHATKOMODO_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	data, _ := io.ReadAll(res.Body)
	if res.StatusCode >= 400 {
		panic(fmt.Sprintf("%d: %s", res.StatusCode, data))
	}
	fmt.Println(string(data))
}
Response 200
{
  "scheduled": {
    "requested_at": 1767225600000,
    "due_at": 1767225600000
  }
}