API reference
Segments API
Group contacts to send broadcasts to.
Paths are relative to https://isent.dev/api/v1. Every request needs an API key; see API overview for errors, rate limits and pagination.
List segments
/segments
Responses
| Status | Meaning |
|---|---|
| 200 | OK. |
| 400 | The body is not valid JSON. |
| 401 | Missing, invalid or restricted API key. |
| 403 | Not allowed: role, key scope, unverified domain, plan limit (plan_limit_reached) or a new team's members-only sending (sending_restricted). |
| 422 | Validation failed. |
| 429 | Rate limit (rate_limit_exceeded), monthly quota (monthly_quota_exceeded) or a new team's daily limit (daily_limit_reached). |
curl -X GET https://isent.dev/api/v1/segments \
-H "Authorization: Bearer $ISENT_API_KEY"Create a segment
/segments
Body
A JSON object.
| Name | Type | Description |
|---|---|---|
name | string | 1 to 100 characters. |
filter | map of any | None |
Responses
| Status | Meaning |
|---|---|
| 201 | Created. |
| 400 | The body is not valid JSON. |
| 401 | Missing, invalid or restricted API key. |
| 403 | Not allowed: role, key scope, unverified domain, plan limit (plan_limit_reached) or a new team's members-only sending (sending_restricted). |
| 409 | Conflict with the current state, or an idempotency key reused. |
| 422 | Validation failed. |
| 429 | Rate limit (rate_limit_exceeded), monthly quota (monthly_quota_exceeded) or a new team's daily limit (daily_limit_reached). |
Retrieve a segment
/segments/{id}
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id | path | string | None |
Responses
| Status | Meaning |
|---|---|
| 200 | OK. |
| 400 | The body is not valid JSON. |
| 401 | Missing, invalid or restricted API key. |
| 403 | Not allowed: role, key scope, unverified domain, plan limit (plan_limit_reached) or a new team's members-only sending (sending_restricted). |
| 404 | Not found. |
| 422 | Validation failed. |
| 429 | Rate limit (rate_limit_exceeded), monthly quota (monthly_quota_exceeded) or a new team's daily limit (daily_limit_reached). |
curl -X GET https://isent.dev/api/v1/segments/{id} \
-H "Authorization: Bearer $ISENT_API_KEY"Update a segment
/segments/{id}
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id | path | string | None |
Body
A JSON object.
| Name | Type | Description |
|---|---|---|
name | string | 1 to 100 characters. |
filter | map of any | null | None |
Responses
| Status | Meaning |
|---|---|
| 200 | OK. |
| 400 | The body is not valid JSON. |
| 401 | Missing, invalid or restricted API key. |
| 403 | Not allowed: role, key scope, unverified domain, plan limit (plan_limit_reached) or a new team's members-only sending (sending_restricted). |
| 404 | Not found. |
| 409 | Conflict with the current state, or an idempotency key reused. |
| 422 | Validation failed. |
| 429 | Rate limit (rate_limit_exceeded), monthly quota (monthly_quota_exceeded) or a new team's daily limit (daily_limit_reached). |
Delete a segment
/segments/{id}
Contacts stay; only the segment goes.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id | path | string | None |
Responses
| Status | Meaning |
|---|---|
| 200 | OK. |
| 400 | The body is not valid JSON. |
| 401 | Missing, invalid or restricted API key. |
| 403 | Not allowed: role, key scope, unverified domain, plan limit (plan_limit_reached) or a new team's members-only sending (sending_restricted). |
| 404 | Not found. |
| 409 | Conflict with the current state, or an idempotency key reused. |
| 422 | Validation failed. |
| 429 | Rate limit (rate_limit_exceeded), monthly quota (monthly_quota_exceeded) or a new team's daily limit (daily_limit_reached). |
curl -X DELETE https://isent.dev/api/v1/segments/{id} \
-H "Authorization: Bearer $ISENT_API_KEY"Add contacts to a segment
/segments/{id}/contacts
By id or email; unknown contacts are skipped.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id | path | string | None |
Body
A JSON object.
| Name | Type | Description |
|---|---|---|
contact_ids | string[] | Up to 1000 items. |
emails | string[] | Up to 1000 items. |
Responses
| Status | Meaning |
|---|---|
| 200 | OK. |
| 400 | The body is not valid JSON. |
| 401 | Missing, invalid or restricted API key. |
| 403 | Not allowed: role, key scope, unverified domain, plan limit (plan_limit_reached) or a new team's members-only sending (sending_restricted). |
| 404 | Not found. |
| 409 | Conflict with the current state, or an idempotency key reused. |
| 422 | Validation failed. |
| 429 | Rate limit (rate_limit_exceeded), monthly quota (monthly_quota_exceeded) or a new team's daily limit (daily_limit_reached). |
Remove a contact from a segment
/segments/{id}/contacts/{contactId}
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id | path | string | None |
contactId | path | string | None |
Responses
| Status | Meaning |
|---|---|
| 200 | OK. |
| 400 | The body is not valid JSON. |
| 401 | Missing, invalid or restricted API key. |
| 403 | Not allowed: role, key scope, unverified domain, plan limit (plan_limit_reached) or a new team's members-only sending (sending_restricted). |
| 404 | Not found. |
| 409 | Conflict with the current state, or an idempotency key reused. |
| 422 | Validation failed. |
| 429 | Rate limit (rate_limit_exceeded), monthly quota (monthly_quota_exceeded) or a new team's daily limit (daily_limit_reached). |
curl -X DELETE https://isent.dev/api/v1/segments/{id}/contacts/{contactId} \
-H "Authorization: Bearer $ISENT_API_KEY"