Anchor to segmentCreatesegment
segmentCreate
mutation
Requires access scope. Also: The user must not have restricted access.
Creates a segment.
Anchor to Arguments
Arguments
- Anchor to namename•String!required
The name of the segment to be created. Segment names must be unique.
- Anchor to queryquery•String!required
A precise definition of the segment. The definition is composed of a combination of conditions on facts about customers such as
with this syntax.
Was this section helpful?
Anchor to SegmentCreatePayload returnsSegmentCreatePayload returns
- Anchor to segmentsegment•
The newly created segment.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
Mutation Reference
1mutation segmentCreate($name: String!, $query: String!) {2 segmentCreate(name: $name, query: $query) {3 segment {4 # Segment fields5 }6 userErrors {7 field8 message9 }10 }11}
Input
1{2 "name": "<your-name>",3 "query": "<your-query>"4}
{
"name": "<your-name>",
"query": "<your-query>"
}