GET /api/v1/topics/{topicId}
One topic, plus what it costs: the number of refusals recorded on it, and the campaigns and
sequences that carry it. That is what tells you in advance why a deletion will be refused.
Authorization
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused — 403 |
member can still read the names and ids with
List topics.
A key carries the role its creator holds in this organization — never a role on AgentsMail
itself. See API keys.
Path parameters
| Parameter | Type | Description |
|---|---|---|
topicId | string | Required. The topic to read |
Example
bash
curl -H "x-api-key: $AGENTMAIL_API_KEY" \
"https://www.agentsmail.io/api/v1/topics/$TOPIC_ID"Response
200 OK— the topic and its usage.401 Unauthorized— missing or invalid key, or its owner left the organization.403 Forbidden— the key's owner is amemberof the organization, not anadmin.404 Not Found— no such topic, or it belongs to another organization. The API never confirms that an id exists to a caller who has no right to it.429 Too Many Requests— over 120 requests in a minute for this key.
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the operation was successful |
data.id | string | Unique identifier for the topic |
data.name | string | Name of the topic, unique in the organization |
data.createdAt | string | ISO creation date |
data.updatedAt | string | ISO date of the last change |
data.optOutCount | number | Contacts who declined this topic — lost if you delete it |
data.campaigns | array | Campaigns carrying it, {id, name, status} |
data.sequences | array | Sequences carrying it, {id, name, status} |
Example response
json
{
"success": true,
"data": {
"id": "7c2e4b19",
"name": "freelancing",
"createdAt": "2026-03-04T08:11:00.000Z",
"updatedAt": "2026-08-01T10:42:19.000Z",
"optOutCount": 42,
"campaigns": [
{"id": "4d19c0a2", "name": "Freelance news", "status": "sent"}
],
"sequences": []
}
}Notes
- The counts are read live. A campaign created a second ago already appears here — which is why a deletion recomputes them rather than trusting what you last read.
- Empty
campaignsandsequencesmean the topic can be deleted.optOutCountsays what that deletion would throw away.