Sby SendGrid
Create a segment
Creates a segment of the contacts that match an SQL-style query, optionally within one list, that updates as contacts change.
Description
Pass a unique `name` and the `query_dsl`; `parent_list_ids` limits the segment to one list. Segment counts refresh every 1 to 24 hours, and a segment built on engagement data takes about 30 minutes to start filling.
create-segment.md
Create a segment
Creates a segment of the contacts that match an SQL-style query, optionally within one list, that updates as contacts change.
Pass a unique name and the query_dsl; parent_list_ids limits the
segment to one list. Segment counts refresh every 1 to 24 hours, and a
segment built on engagement data takes about 30 minutes to start filling.
Set up
Use the first option your agent supports.
API (official)
- Base URL: https://api.sendgrid.com
- Endpoint:
POST /v3/marketing/segments/2.0 - Auth: send the header
Authorization: Bearer $SENDGRID_API_KEY - Get a key: https://app.sendgrid.com/settings/api_keys
- Docs: https://www.twilio.com/docs/sendgrid/api-reference
Before doing anything else, make one read-only call to confirm access.
Rules
- Ask the user before anything that sends messages, costs money, or changes data.
- Never print API keys.
Built from these files in the repository
The layout and the rules come from lib/catalog/render-markdown.ts, the set-up wording from lib/catalog/render-access.ts.
Ways in
| Route | Source | Call | Required | Docs |
|---|---|---|---|---|
| Official | POST /v3/marketing/segments/2.0 | API key in $SENDGRID_API_KEY | Docs |