Segments API
Static and rule-based segments of the audience.
8 operations. Guide: Manage contacts and consent. Requests and responses are JSON with snake_case fields; authenticate with Authorization: Bearer <api key>. The examples assume a client built as in SDKs and the command line.
Create a segment
POST /v1/segments
static segments hold members you add; dynamic ones match their rules whenever they are read.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | 1 to 100 characters. |
kind | one of "static", "dynamic" | no | Default "static". |
rules | object | no | |
rules (shape 1). | array of object | yes | At most 50 items. |
rules (shape 1). | string | yes | At most 120 characters. |
rules (shape 1). | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
rules (shape 1). | string or number or boolean or array of string or null | no | |
rules (shape 2). | array of object | yes | At most 50 items. |
rules (shape 2). | string | yes | At most 120 characters. |
rules (shape 2). | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
rules (shape 2). | string or number or boolean or array of string or null | no |
Response
201 Created: Segment.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | A UUID. |
object | "segment" | yes | |
project_id | string | yes | A UUID. |
name | string | yes | |
kind | one of "static", "dynamic" | yes | |
rules | object or null | yes | |
rules (shape 1). | array of object | yes | At most 50 items. |
rules (shape 1). | string | yes | At most 120 characters. |
rules (shape 1). | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
rules (shape 1). | string or number or boolean or array of string or null | no | |
rules (shape 2). | array of object | yes | At most 50 items. |
rules (shape 2). | string | yes | At most 120 characters. |
rules (shape 2). | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
rules (shape 2). | string or number or boolean or array of string or null | no | |
contacts_count | integer or null | yes | |
created_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
updated_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X POST https://api.minket.com/v1/segments \
-H "Authorization: Bearer $MINKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Customers"}'const result = await minket.segments.create({
name: "Customers"
});minket api createSegment --body '{"name":"Customers"}'from minket.api.segments import create_segment
from minket.models import CreateSegmentBody
result = create_segment.sync(client=client, body=CreateSegmentBody.from_dict({"name":"Customers"}))var body minket.CreateSegmentJSONRequestBody
res, err := client.CreateSegmentWithResponse(ctx, body)List segments
GET /v1/segments
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | no | Default 20. |
after | query | string | no | A UUID. |
before | query | string | no | A UUID. |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "list" | yes | |
data | array of Segment | yes | |
data[]. | string | yes | A UUID. |
data[]. | "segment" | yes | |
data[]. | string | yes | A UUID. |
data[]. | string | yes | |
data[]. | one of "static", "dynamic" | yes | |
data[]. | object or null | yes | |
data[]. | array of object | yes | At most 50 items. |
data[]. | string | yes | At most 120 characters. |
data[]. | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
data[]. | string or number or boolean or array of string or null | no | |
data[]. | array of object | yes | At most 50 items. |
data[]. | string | yes | At most 120 characters. |
data[]. | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
data[]. | string or number or boolean or array of string or null | no | |
data[]. | integer or null | yes | |
data[]. | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
data[]. | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
has_more | boolean | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl https://api.minket.com/v1/segments \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.segments.list();minket api listSegmentsfrom minket.api.segments import list_segments
result = list_segments.sync(client=client)res, err := client.ListSegmentsWithResponse(ctx, &minket.ListSegmentsParams{})Get a segment
GET /v1/segments/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | A UUID. |
Response
200 Success: Segment.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | A UUID. |
object | "segment" | yes | |
project_id | string | yes | A UUID. |
name | string | yes | |
kind | one of "static", "dynamic" | yes | |
rules | object or null | yes | |
rules (shape 1). | array of object | yes | At most 50 items. |
rules (shape 1). | string | yes | At most 120 characters. |
rules (shape 1). | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
rules (shape 1). | string or number or boolean or array of string or null | no | |
rules (shape 2). | array of object | yes | At most 50 items. |
rules (shape 2). | string | yes | At most 120 characters. |
rules (shape 2). | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
rules (shape 2). | string or number or boolean or array of string or null | no | |
contacts_count | integer or null | yes | |
created_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
updated_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl https://api.minket.com/v1/segments/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.segments.get("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b");minket api getSegment 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5bfrom minket.api.segments import get_segment
result = get_segment.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client)res, err := client.GetSegmentWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b")Update a segment
PATCH /v1/segments/{id}
Renames it or, for a dynamic segment, replaces its rules. The kind is fixed.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | A UUID. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | 1 to 100 characters. |
kind | one of "static", "dynamic" | no | Default "static". |
rules | object | no | |
rules (shape 1). | array of object | yes | At most 50 items. |
rules (shape 1). | string | yes | At most 120 characters. |
rules (shape 1). | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
rules (shape 1). | string or number or boolean or array of string or null | no | |
rules (shape 2). | array of object | yes | At most 50 items. |
rules (shape 2). | string | yes | At most 120 characters. |
rules (shape 2). | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
rules (shape 2). | string or number or boolean or array of string or null | no |
Response
200 Success: Segment.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | A UUID. |
object | "segment" | yes | |
project_id | string | yes | A UUID. |
name | string | yes | |
kind | one of "static", "dynamic" | yes | |
rules | object or null | yes | |
rules (shape 1). | array of object | yes | At most 50 items. |
rules (shape 1). | string | yes | At most 120 characters. |
rules (shape 1). | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
rules (shape 1). | string or number or boolean or array of string or null | no | |
rules (shape 2). | array of object | yes | At most 50 items. |
rules (shape 2). | string | yes | At most 120 characters. |
rules (shape 2). | one of "eq", "neq", "contains", "not_contains", "starts_with", "ends_with", "gt", "gte", "lt", "lte", "is_set", "is_not_set", … | yes | |
rules (shape 2). | string or number or boolean or array of string or null | no | |
contacts_count | integer or null | yes | |
created_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
updated_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X PATCH https://api.minket.com/v1/segments/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b \
-H "Authorization: Bearer $MINKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Paying customers"}'const result = await minket.segments.update("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", {
name: "Paying customers"
});minket api updateSegment 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b --body '{"name":"Paying customers"}'from minket.api.segments import update_segment
from minket.models import UpdateSegmentBody
result = update_segment.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client, body=UpdateSegmentBody.from_dict({"name":"Paying customers"}))var body minket.UpdateSegmentJSONRequestBody
res, err := client.UpdateSegmentWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", body)Delete a segment
DELETE /v1/segments/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | A UUID. |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "segment" | yes | |
id | string | yes | |
deleted | true | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X DELETE https://api.minket.com/v1/segments/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.segments.delete("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b");minket api deleteSegment 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5bfrom minket.api.segments import delete_segment
result = delete_segment.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client)res, err := client.DeleteSegmentWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b")List a segment's contacts
GET /v1/segments/{id}/contacts
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | A UUID. |
limit | query | integer | no | Default 20. |
after | query | string | no | A UUID. |
before | query | string | no | A UUID. |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "list" | yes | |
data | array of object | yes | |
data[]. | string | yes | A UUID. |
data[]. | "contact" | yes | |
data[]. | string | yes | A UUID. |
data[]. | string | yes | |
data[]. | string or null | yes | |
data[]. | string or null | yes | |
data[]. | boolean | yes | |
data[]. | one of "active", "unsubscribed", "bounced", "complained", "sunset" | yes | |
data[]. | map of string or number or boolean or null | yes | |
data[]. | string (date-time) or null | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
data[]. | string (date-time) or null | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
data[]. | string (date-time) or null | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
data[]. | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
data[]. | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
has_more | boolean | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl https://api.minket.com/v1/segments/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b/contacts \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.segments.contacts.list("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b");minket api listSegmentContacts 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5bfrom minket.api.segments import list_segment_contacts
result = list_segment_contacts.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client)res, err := client.ListSegmentContactsWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", &minket.ListSegmentContactsParams{})Add contacts to a static segment
POST /v1/segments/{id}/contacts
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | A UUID. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
contact_ids | array of string | no | At most 1000 items. |
emails | array of string | no | At most 1000 items. |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "segment" | yes | |
id | string | yes | |
added | integer | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X POST https://api.minket.com/v1/segments/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b/contacts \
-H "Authorization: Bearer $MINKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"emails":["jane@example.com"]}'const result = await minket.segments.contacts.add("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", {
emails: [
"jane@example.com"
]
});minket api addSegmentContacts 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b --body '{"emails":["jane@example.com"]}'from minket.api.segments import add_segment_contacts
from minket.models import AddSegmentContactsBody
result = add_segment_contacts.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client, body=AddSegmentContactsBody.from_dict({"emails":["jane@example.com"]}))var body minket.AddSegmentContactsJSONRequestBody
res, err := client.AddSegmentContactsWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", body)Remove contacts from a static segment
DELETE /v1/segments/{id}/contacts
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | A UUID. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
contact_ids | array of string | no | At most 1000 items. |
emails | array of string | no | At most 1000 items. |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "segment" | yes | |
id | string | yes | |
removed | integer | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X DELETE https://api.minket.com/v1/segments/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b/contacts \
-H "Authorization: Bearer $MINKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"emails":["jane@example.com"]}'const result = await minket.segments.contacts.remove("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", {
emails: [
"jane@example.com"
]
});minket api removeSegmentContacts 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b --body '{"emails":["jane@example.com"]}'from minket.api.segments import remove_segment_contacts
from minket.models import RemoveSegmentContactsBody
result = remove_segment_contacts.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client, body=RemoveSegmentContactsBody.from_dict({"emails":["jane@example.com"]}))var body minket.RemoveSegmentContactsJSONRequestBody
res, err := client.RemoveSegmentContactsWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", body)