action sendgrid_get_contactdb_segments { label: "Retrieve all segments" description: "**This endpoint allows you to retrieve all of your segments.**" provider: sendgrid method: GET path: "/contactdb/segments" encoding: json output: { type: "object" required: ["segments"] properties: { segments: { type: "array" items: { type: "object" required: ["name", "conditions"] properties: { conditions: { type: "array" description: "The conditions for a recipient to be included in this segment." items: { type: "object" required: ["field", "value", "operator"] properties: { and_or: { type: "string" enum: ["and", "or", ""] } field: { type: "string" } operator: { type: "string" enum: ["eq", "ne", "lt", "gt", "contains"] } value: { type: "string" } } } } list_id: { type: "integer" description: "The list id from which to make this segment. Not including this ID will mean your segment is created from the main contactdb rather than a list." } name: { type: "string" description: "The name of this segment." } recipient_count: { type: "number" description: "The count of recipients in this list. This is not included on creation of segments." } } } } } } }