Ndoto Docs

Labels

Create and manage conversation labels via the API

Labels

Labels are color-coded tags used to categorize conversations. They can be applied manually by agents or automatically through automation rules.

Base path: /api/v1/accounts/:account_id/labels


List labels

Returns all labels in your account.

GET /api/v1/accounts/:account_id/labels

Response

{
  "payload": [
    {
      "id": 3,
      "title": "billing",
      "description": "Billing and payment questions",
      "color": "#1F93FF",
      "show_on_sidebar": true,
      "created_at": 1711000000
    }
  ]
}
const response = await fetch(
  'https://app.usendoto.com/api/v1/accounts/1/labels',
  {
    headers: { 'api_access_token': 'YOUR_TOKEN' },
  }
);
const data = await response.json();
console.log(data.payload);
import requests

response = requests.get(
    'https://app.usendoto.com/api/v1/accounts/1/labels',
    headers={'api_access_token': 'YOUR_TOKEN'},
)
print(response.json())
<?php
$ch = curl_init('https://app.usendoto.com/api/v1/accounts/1/labels');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['api_access_token: YOUR_TOKEN'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
import 'package:http/http.dart' as http;
import 'dart:convert';

final response = await http.get(
  Uri.parse('https://app.usendoto.com/api/v1/accounts/1/labels'),
  headers: {'api_access_token': 'YOUR_TOKEN'},
);
print(jsonDecode(response.body));
require 'net/http'
require 'json'

uri = URI('https://app.usendoto.com/api/v1/accounts/1/labels')
req = Net::HTTP::Get.new(uri)
req['api_access_token'] = 'YOUR_TOKEN'

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts JSON.parse(res.body)

Create a label

Creates a new label.

POST /api/v1/accounts/:account_id/labels

Body parameters

ParameterTypeRequiredDescription
titlestringYesLabel name. Must be unique and lowercase
descriptionstringNoDescription of what the label means
colorstringNoHex color code (e.g. #FF5733)
show_on_sidebarbooleanNoWhether to show this label in the sidebar. Default: false
const response = await fetch(
  'https://app.usendoto.com/api/v1/accounts/1/labels',
  {
    method: 'POST',
    headers: {
      'api_access_token': 'YOUR_TOKEN',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      title: 'billing',
      description: 'Billing and payment questions',
      color: '#1F93FF',
      show_on_sidebar: true,
    }),
  }
);
const label = await response.json();
console.log(label);
response = requests.post(
    'https://app.usendoto.com/api/v1/accounts/1/labels',
    headers={'api_access_token': 'YOUR_TOKEN'},
    json={
        'title': 'billing',
        'description': 'Billing and payment questions',
        'color': '#1F93FF',
        'show_on_sidebar': True,
    },
)
print(response.json())
<?php
$ch = curl_init('https://app.usendoto.com/api/v1/accounts/1/labels');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => json_encode([
        'title'           => 'billing',
        'description'     => 'Billing and payment questions',
        'color'           => '#1F93FF',
        'show_on_sidebar' => true,
    ]),
    CURLOPT_HTTPHEADER => [
        'api_access_token: YOUR_TOKEN',
        'Content-Type: application/json',
    ],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
final response = await http.post(
  Uri.parse('https://app.usendoto.com/api/v1/accounts/1/labels'),
  headers: {
    'api_access_token': 'YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body: jsonEncode({
    'title': 'billing',
    'description': 'Billing and payment questions',
    'color': '#1F93FF',
    'show_on_sidebar': true,
  }),
);
print(jsonDecode(response.body));
uri = URI('https://app.usendoto.com/api/v1/accounts/1/labels')
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
req['api_access_token'] = 'YOUR_TOKEN'
req.body = JSON.dump(
  title: 'billing',
  description: 'Billing and payment questions',
  color: '#1F93FF',
  show_on_sidebar: true
)

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts JSON.parse(res.body)

Update a label

Updates an existing label.

PATCH /api/v1/accounts/:account_id/labels/:id
const response = await fetch(
  'https://app.usendoto.com/api/v1/accounts/1/labels/3',
  {
    method: 'PATCH',
    headers: {
      'api_access_token': 'YOUR_TOKEN',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ color: '#FF5733', show_on_sidebar: false }),
  }
);
const updated = await response.json();
console.log(updated);
response = requests.patch(
    'https://app.usendoto.com/api/v1/accounts/1/labels/3',
    headers={'api_access_token': 'YOUR_TOKEN'},
    json={'color': '#FF5733', 'show_on_sidebar': False},
)
print(response.json())
<?php
$ch = curl_init('https://app.usendoto.com/api/v1/accounts/1/labels/3');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'PATCH',
    CURLOPT_POSTFIELDS     => json_encode(['color' => '#FF5733', 'show_on_sidebar' => false]),
    CURLOPT_HTTPHEADER     => [
        'api_access_token: YOUR_TOKEN',
        'Content-Type: application/json',
    ],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
final response = await http.patch(
  Uri.parse('https://app.usendoto.com/api/v1/accounts/1/labels/3'),
  headers: {
    'api_access_token': 'YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body: jsonEncode({'color': '#FF5733', 'show_on_sidebar': false}),
);
print(jsonDecode(response.body));
uri = URI('https://app.usendoto.com/api/v1/accounts/1/labels/3')
req = Net::HTTP::Patch.new(uri, 'Content-Type' => 'application/json')
req['api_access_token'] = 'YOUR_TOKEN'
req.body = JSON.dump(color: '#FF5733', show_on_sidebar: false)

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts JSON.parse(res.body)

Delete a label

Deletes a label. Removing a label from this list removes it from all conversations it was applied to.

DELETE /api/v1/accounts/:account_id/labels/:id
const response = await fetch(
  'https://app.usendoto.com/api/v1/accounts/1/labels/3',
  {
    method: 'DELETE',
    headers: { 'api_access_token': 'YOUR_TOKEN' },
  }
);
console.log(response.status); // 200
response = requests.delete(
    'https://app.usendoto.com/api/v1/accounts/1/labels/3',
    headers={'api_access_token': 'YOUR_TOKEN'},
)
print(response.status_code)
<?php
$ch = curl_init('https://app.usendoto.com/api/v1/accounts/1/labels/3');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_HTTPHEADER     => ['api_access_token: YOUR_TOKEN'],
]);
curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
final response = await http.delete(
  Uri.parse('https://app.usendoto.com/api/v1/accounts/1/labels/3'),
  headers: {'api_access_token': 'YOUR_TOKEN'},
);
print(response.statusCode);
uri = URI('https://app.usendoto.com/api/v1/accounts/1/labels/3')
req = Net::HTTP::Delete.new(uri)
req['api_access_token'] = 'YOUR_TOKEN'

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code

On this page