What are goals?
A goal is something one user is working towards: an essay due on Friday, an exam on November 20, or 50 lessons this month. You tell Trophy about each user’s goals through the Application API, and agentic messaging uses them to remind users before a goal is due, encourage them when they miss one and celebrate the ones they complete. Goals belong to a single user. Each one has akey that you choose, unique for that user, which you use to update or delete it. The user must already exist in Trophy, so identify the user before creating their goals.
Key attributes
The goal’s key, unique per user. 1–100 letters, numbers, hyphens or
underscores.
plural and singular are reserved.What the goal is, up to 200 characters. Messages name the goal by its label,
so write it the way you’d want it to read in a message, for example “Spanish
B1 exam”.
How the goal is completed:
manual, none or metric. See completion
types.When the goal is due, as an ISO 8601 date and time. A time without an offset,
like
2026-11-20T09:00:00, is in the user’s time zone, so set the user’s
tz. Required for goals with
completion: none.Whether the user has completed the goal. Only for goals with
completion: manual.Goals with
completion: metric only. The key of the metric
that counts towards the goal.Goals with
completion: metric only. The metric total that completes the
goal. Must be greater than 0.Goals with
completion: metric only. The date, as YYYY-MM-DD in the user’s
time zone, that the metric total counts from. Defaults to the user’s today.The goal’s steps, in order, up to 100.
Completion types
A goal’scompletion says how it’s completed.
Manual goals
Manual goals are for things the user finishes in your app, like submitting an essay. Mark the goal completed withcompleted: true when they do, and set completed: false to undo it.
Dates to work towards
Goals withcompletion: none are dates the user prepares for, like an exam or a race. There’s nothing to mark as done, so they need a dueAt and are never completed. Messages about them help the user prepare, rather than urging them to finish.
Metric goals
Metric goals complete themselves. Each goal counts the user’s total for itsmetric from start onwards, and Trophy marks it completed as soon as an event brings that total to the target.
Changing a metric goal’s metric, target or start checks it against its target again, which can complete it or, if the new total falls short, uncomplete it. Metric goals can’t be marked completed with completed.
Steps
A goal can have steps, which turns it into a plan. For example, a study plan for an exam might have a step for each unit, each with its own due time. Steps are one level deep and each one is a goal in its own right. A step has its ownkey, unique among all of the user’s goals, and its own label, completion, dueAt and metric. You update, complete and delete a step through its own key, just like any other goal.
A goal with steps also tracks how many of them are completed, which messages use to show the user’s progress through the plan.
Status
Each goal has astatus, which Trophy works out from the goal whenever you retrieve it:
Managing goals
Creating goals
Create a goal with the create goal endpoint. Here’s a goal for an exam the user is preparing for:409.
Creating a plan
Passsteps to create a goal and its steps in one request:
parent:
Updating goals
Update a goal or a step with the update goal endpoint. Fields you leave out stay as they are, andnull clears a label or dueAt. Here’s a goal being marked completed:
steps replaces all of the goal’s steps, in the order given: steps whose key the goal already has are updated, new keys are added, and steps you leave out are deleted. Use it to reorder or rebuild a plan, and the parent field on create to add one step at a time.
Replace a goal's steps
Deleting goals
Delete a goal or a step with the delete goal endpoint. Deleting a goal deletes its steps too. Once it’s deleted, its key is free to use for a new goal.Retrieving goals
The user goals endpoint returns all of a user’s goals, soonest due first and then those with no due time. Each goal includes itsstatus and its steps, a goal with steps adds done and total, and a metric goal adds its metric, target, start and current total:
Response
How agents use goals
Agents read each user’s goals and decide when a message about one is worth sending, the same way they decide about everything else. Every goal gives them three moments to work with:- Before it’s due: agents can remind the user about a goal that isn’t completed. Reminders come more often as the due date gets closer, and on the due date a reminder can arrive a few hours before the due time. Goals without a due time can be mentioned while the user is active in your app.
- When it’s missed: once a
manualormetricgoal’s due time passes without it being completed, agents can encourage the user to get back on track. - When it’s completed: agents can celebrate a completed goal, once per goal.
manual or metric goal is something to finish, while a none goal is a date to prepare for.
Before a scheduled message about a goal sends, Trophy checks that it still applies. A reminder is cancelled if the goal has been completed, its due time or completion type has changed, or its due time has passed. See send-time checks.
Goals created already completed or past due, or moved to a due time that has already passed, don’t get a completion or missed message. That means you can import a user’s past goals without sending them messages about them. Steps of a completed goal don’t get messages either.
Frequently asked questions
Do I need to set goals up in the dashboard?
Do I need to set goals up in the dashboard?
No. Goals are created per user through the API. The only setup is for
metric goals, whose
metric must be a metric you’ve
already created.What happens when I move a goal's due time?
What happens when I move a goal's due time?
Reminders already scheduled for the old due time are cancelled, and agents
plan around the new one.
Can I reuse a key after deleting a goal?
Can I reuse a key after deleting a goal?
Yes. A goal created with a deleted goal’s key is a new goal, so its
messages are planned from scratch.
How many goals can a user have?
How many goals can a user have?
As many as you like. Each goal can have up to 100 steps.