List segments
List a contact book's segments, oldest first.
GET
https://app.usenotix.dev/api/v1/contactBooks/{contactBookId}/segmentsFull access and read only keys can call this. Sending access keys cannot. Key permissions lists the extra rules some calls have.
List a contact book's segments, oldest first. Each carries its live count and any problems that make it match nothing.
Path parameters
contactBookIdstringrequired
Headers
Authorizationstringrequired
Bearer followed by your API key.
Errors
404
No contact book with this id for the calling team.
Every error has the same shape. See all error codes.
curl -X GET "https://app.usenotix.dev/api/v1/contactBooks/<contactBookId>/segments" \
-H "Authorization: Bearer $NOTIX_API_KEY"
import { Notix } from "notix-js";
const notix = new Notix(process.env.NOTIX_API_KEY);
const { data, error } = await notix.segments.list("cb_123");
data?.data.forEach((segment) => console.log(segment.name, segment.count));
from notix import Notix
notix = Notix() # reads NOTIX_API_KEY
segments, _ = notix.segments.list("cb_123")
for segment in segments["data"]:
print(segment["name"], segment["count"])
use Notix\Notix;
$notix = new Notix(getenv('NOTIX_API_KEY'));
$segments = $notix->segments->list('cb_123');
foreach ($segments['data'] as $segment) {
echo $segment['name'], ' ', $segment['count'], PHP_EOL;
}
Response200
{
"data": [
{
"id": "cm1x8f3k20001qz7v5b9d2e4a",
"contactBookId": "cm1x8f3k20001qz7v5b9d2e4a",
"name": "Acme",
"description": "string",
"definition": {
"version": null,
"match": null,
"conditions": null
},
"count": 1,
"problems": [
null
],
"createdAt": "string",
"updatedAt": "string",
"source": {
"provider": null,
"migratedAt": null
}
}
]
}