Get a topic

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 organizationThis endpoint
OWNERAllowed
ADMINAllowed
MEMBERRefused — 403
This one is stricter than the listing: knowing what a topic holds is the same right as deleting it. A 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

ParameterTypeDescription
topicIdstringRequired. 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 a member of the organization, not an admin.
  • 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

FieldTypeDescription
successbooleanIndicates if the operation was successful
data.idstringUnique identifier for the topic
data.namestringName of the topic, unique in the organization
data.createdAtstringISO creation date
data.updatedAtstringISO date of the last change
data.optOutCountnumberContacts who declined this topic — lost if you delete it
data.campaignsarrayCampaigns carrying it, {id, name, status}
data.sequencesarraySequences 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 campaigns and sequences mean the topic can be deleted. optOutCount says what that deletion would throw away.