journeyPlans
Requires permission visits:journey-plan:manage.
Lists sales reps' journey plans over a date range, optionally for one rep or filtered. Send skip and take to page, and use journeyPlansCount for the total. Requires permission to manage journey plans.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query JourneyPlans($dateFrom: DateTime!, $dateTo: DateTime!) {
journeyPlans(dateFrom: $dateFrom, dateTo: $dateTo) {
id
salesRepName
createdAt
notes
planDate
salesRepId
visits {
id
partnerName
status
createdAt
completedAt
hasUnreadMessage
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query JourneyPlans($dateFrom: DateTime!, $dateTo: DateTime!) {\n journeyPlans(dateFrom: $dateFrom, dateTo: $dateTo) {\n id\n salesRepName\n createdAt\n notes\n planDate\n salesRepId\n visits {\n id\n partnerName\n status\n createdAt\n completedAt\n hasUnreadMessage\n }\n }\n}",
"variables": {
"dateFrom": "2025-01-15T00:00:00Z",
"dateTo": "2025-01-15T00:00:00Z"
}
}
EOF
Variables:
{
"dateFrom": "2025-01-15T00:00:00Z",
"dateTo": "2025-01-15T00:00:00Z"
}
Response:
{
"data": {
"journeyPlans": [
{
"id": "id",
"salesRepName": "string",
"createdAt": "2025-01-15T00:00:00Z",
"notes": "string",
"planDate": "2025-01-15T00:00:00Z",
"salesRepId": "string",
"visits": [
{
"id": "id",
"partnerName": "string",
"status": "CANCELLED",
"createdAt": "2025-01-15T00:00:00Z",
"completedAt": "2025-01-15T00:00:00Z",
"hasUnreadMessage": true
}
]
}
]
}
}
journeyPlans(
dateFrom: DateTime!
dateTo: DateTime!
filter: JourneyPlanListFilterInput
salesRepId: ID
skip: Int
take: Int
): [JourneyPlan!]!
Arguments
journeyPlans.dateFrom ● DateTime! non-null scalar
The first day of the range.
journeyPlans.dateTo ● DateTime! non-null scalar
The last day of the range.
journeyPlans.filter ● JourneyPlanListFilterInput input
Optional filters: search text, status and sort order.
journeyPlans.salesRepId ● ID scalar
The ID of the sales rep to list plans for. Omit it for every rep.
journeyPlans.skip ● Int scalar
How many plans to skip. Omit skip and take to return the whole range.
journeyPlans.take ● Int scalar
How many plans to return.
Type
JourneyPlan object
A rep's plan for one day: the stops they will visit.