curl --request POST \
--url https://api.politicalcomms.com/v1/tags \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Door knockers"
}
'{
"success": true,
"data": {
"id": "c84a1e07-3d5b-4f92-b6a0-7e2d9c1f5a48",
"name": "Donated in the last 30 days",
"kind": "activity",
"activity_event": "donated",
"within_days": 30,
"member_count": null,
"member_count_capped": false,
"created_at": "2026-11-17T14:05:40.000Z",
"organization_id": "9d2e6a40-1c73-4b58-a0f9-3e8b5c7d2a16"
}
}Create Tag
Create a manual tag by name, or an activity tag by activity_event (with an optional within_days). Send exactly one of the two shapes; unknown properties are rejected with a 400. Tag names are unique per organization, ignoring case. Creating an activity tag that already exists returns the existing tag with 200 instead of 201.
curl --request POST \
--url https://api.politicalcomms.com/v1/tags \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Door knockers"
}
'{
"success": true,
"data": {
"id": "c84a1e07-3d5b-4f92-b6a0-7e2d9c1f5a48",
"name": "Donated in the last 30 days",
"kind": "activity",
"activity_event": "donated",
"within_days": 30,
"member_count": null,
"member_count_capped": false,
"created_at": "2026-11-17T14:05:40.000Z",
"organization_id": "9d2e6a40-1c73-4b58-a0f9-3e8b5c7d2a16"
}
}Authorizations
Authenticate every request by passing your API key in the X-API-Key header. Keys are scoped to your organization hierarchy. A key carries up to three permissions: public:read for GET requests, public:write for POST, PATCH, and PUT requests, and public:delete for DELETE requests. public:delete is only available together with public:write.
Headers
Optional idempotency key: a unique string of 16-200 printable ASCII characters (a UUID is recommended). Retrying the write with the same key within 24 hours returns the stored response of the first call with an X-Idempotent-Replayed: true response header instead of executing it again. Reusing a key with a different request body returns 422 (IDEMPOTENCY_MISMATCH); a duplicate sent while the first call is still running returns 409 with a Retry-After header. Keys are scoped per endpoint and organization.
16 - 200Body
Response
The activity tag already existed; it is returned unchanged.
