🌞 Connect to GoalsWon by API, MCP or CLI

Access your GoalsWon data programmatically — build integrations, connect AI assistants, reduce the hassle of manual data entry, or manage your goals from the terminal - we’re here to support, your coach is on board and the sky is the limit!


What You Can Do

  • Connect AI assistants (Claude, Gemini, etc.) to your GoalsWon data via MCP
  • Integrate with automations — hook in with Zapier, Make, n8n, IFTTT, etc.
  • Pull your data — goals, daily results, monthly and yearly targets, inbox, wins, and chat history
  • Create and update goals — add goals, mark them done, manage monthly and yearly targets
  • Send messages and images to your coach
  • View your progress — completion rates, streaks, and trends over any date range
  • Search your chat history with your coach
  • Build custom integrations — spreadsheets, dashboards, automations, whatever you need

Three tools are available:

ToolBest For
REST APICustom integrations, apps, scripts
MCP ServerAI assistants that support MCP (Claude, Gemini, Cursor, etc.)
CLIQuick access from your terminal

All three use the same API key for authentication.


Getting Started

1. Get Your API Key

Generate an API key from your GoalsWon account:

  1. Open GoalsWon (web or mobile)
  2. Go to Settings > API Access
  3. Click Generate API Key
  4. Copy your key — it’s only shown once

Your API key is personal and gives full access to your account. Keep it secret.

2. Try It Out

# Check the API is reachable
curl https://api.goalswon.com/api/v1/health

# Fetch your profile
curl -H "X-GoalsWon-Key: YOUR_API_KEY" \
  https://api.goalswon.com/api/v1/me

# List today's goals
curl -H "X-GoalsWon-Key: YOUR_API_KEY" \
  "https://api.goalswon.com/api/v1/goals?date=2026-03-06"

Authentication

Include your API key in every request using the X-GoalsWon-Key header:

X-GoalsWon-Key: YOUR_API_KEY

Managing Your Keys

You can create multiple keys (e.g. one for Claude, one for a script) and revoke them individually.

POST   /api/v1/me/api-keys          — Create a new key
GET    /api/v1/me/api-keys          — List your keys
DELETE /api/v1/me/api-keys/:keyId   — Revoke a key

Access Levels

Your API access is controlled by three independent permissions, which you can toggle from Settings > API Access in the GoalsWon app:

PermissionWhat it allowsDefault
ReadFetch your profile, goals, targets, days, months, inbox, wins, recurring goals, progress, and chat historyOff
ChatSend messages and images to your coachOff
WriteCreate, update, and delete goals, targets, inbox items, and recurring goals, and manage day/month submissionsOff

These are stored on your user document as apiReadAccess, apiChatAccess, and apiWriteAccess. The API middleware checks them on every request — if a permission is off, the corresponding endpoints return 403 Forbidden.

Each permission is independent. For example, you can enable Read and Chat but leave Write off if you only want to view your data and message your coach without risking accidental changes.

Enabling Write access requires typing a confirmation word as a safety measure, since write operations can modify or delete your data.


Rate Limits

To keep things fair, requests are rate-limited per account:

WindowLimit
Per minute25 requests
Per day1,000 requests

Response headers tell you how many requests you have left:

  • X-RateLimit-Remaining-Minute
  • X-RateLimit-Remaining-Day

If you exceed a limit, you’ll get a 429 response with a Retry-After header.


Data Safety

All deletes made via the API (including MCP and CLI) are archived before removal. Deleted documents are copied to archive/{userId}/{collection}/{docId} with a timestamp before being removed. This means accidental mass-deletes can be recovered.

  • Archive retention: 30 days (auto-purged after that)
  • Only API deletes are archived — deletes from the app are not affected
  • Restore is manual for now — contact support if you need data recovered

REST API Reference

Base URL: https://api.goalswon.com/api/v1

Response Format

// Single item
{ "data": { ... } }

// List with pagination
{
  "data": [ ... ],
  "meta": {
    "hasMore": true,
    "nextCursor": "abc123"
  }
}

// Error
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Goal not found"
  }
}

Pagination

List endpoints return up to 50 items by default. Use these query parameters to page through results:

  • ?limit=50 — Items per page (max 200)
  • ?cursor=abc123 — Continue from where the last page left off (use the nextCursor value from meta)

Your Profile

MethodPathDescription
GET/meYour profile and stats
GET/me/coachYour coach’s public profile

/me/coach returns the same coach details the app shows: name, description, coachingApproach, location, timezone, favouriteQuote, funFact, image, latestMilestone, nextTarget, and statusImage.

Returns your account info, coach name, and counters:

{
  "data": {
    "id": "abc123",
    "email": "you@example.com",
    "name": "Alex",
    "avatar": "https://...",
    "timezone": "America/New_York",
    "isCoach": false,
    "coachName": "Joel",
    "counters": {
      "goalsTotal": 142,
      "recurrentGoalsTotal": 5,
      "milestonesTotal": 3,
      "yearlyTargetsTotal": 4,
      "yearlyTargetsCompleted": 1
    }
  }
}

Goals

MethodPathDescription
GET/goalsList your goals
GET/goals/:idGet a single goal
POST/goalsCreate a goal
PUT/goals/:idUpdate a goal
POST/goals/:id/completeMark a goal done, partial, or pending
DELETE/goals/:idDelete a goal
GET/goals/recurringList your recurring goal templates
GET/goals/recurring/:idGet a single recurring goal
POST/goals/recurringCreate a recurring goal
PUT/goals/recurring/:idUpdate a recurring goal
DELETE/goals/recurring/:idDelete a recurring goal

Filters for listing: ?date=YYYY-MM-DD, ?status=done|partial|pending

Recurring goals appear in the daily goal list with isRecurring: true. Use /goals/recurring to manage the templates and their schedules.

Create a goal:

{
  "name": "Morning meditation",
  "date": "2026-03-10",
  "description": "10 minutes mindfulness",
  "tag": "green"
}
FieldRequiredDescription
nameYesGoal name
dateNoDate (YYYY-MM-DD). Defaults to today based on your account timezone.
descriptionNoDescription text
tagNoColour name (see below)

All fields can also be updated via PUT, plus isDone and isPartiallyDone (booleans).

Tags are colours matching the colour picker in the app:

red, orange, green, blue, purple, pink, yellow, teal, cyan, lavender

Leave tag empty or omit it for no colour. Tags work the same across goals, recurring goals, monthly targets, and inbox items.

Recurring goals: When listing goals for a date, recurring goals that haven’t been interacted with yet are returned with an ID prefixed recurring_ (e.g., recurring_abc123). You can complete or update these directly — the API will automatically instantiate them as real goals on first interaction.

Mark a goal:

{ "status": "done" }

Status can be done, partial, or pending.

Submitted days are read-only. Once a day has been submitted (reviewed by your coach), its goals cannot be created, updated, marked, or deleted via the API. You’ll receive a 409 response with code DAY_SUBMITTED. You can still read goals on submitted days.

Create a recurring goal:

{
  "name": "Morning run",
  "recurrencePattern": "weekly",
  "days": [1, 3, 5],
  "startDate": "2026-03-10",
  "rollOver": true,
  "tag": "green"
}
FieldRequiredDescription
nameYesGoal name
recurrencePatternYesdaily, weekly, monthly, or yearly
daysWeeklyArray of weekday numbers: 1=Monday through 7=Sunday
startDateNoStart date (YYYY-MM-DD). Defaults to today. For monthly/yearly, the day-of-month is used.
endDateNoEnd date (YYYY-MM-DD), or omit/null for never
rollOverNotrue to roll over incomplete goals to the next day. Defaults to false
descriptionNoDescription text
tagNoColour name (e.g., red, blue, yellow)

For monthly, the goal repeats on the same day-of-month as the start date (e.g. start on March 6th → repeats every 6th). For yearly, it repeats on the same month and day.


Days

View your daily submissions and how you did each day.

MethodPathDescription
GET/daysList your day submissions
GET/days/:YYYYMMDDFull day detail with all goals
POST/days/:YYYYMMDD/submitSubmit a day
POST/days/:YYYYMMDD/unsubmitUnsubmit a day

Filters: ?from=YYYY-MM-DD, ?to=YYYY-MM-DD, ?submitted=true|false

Defaults to the last 30 days if no from date is specified. Use ?from= with an earlier date to fetch further back.

Day detail includes a summary:

{
  "data": {
    "id": "20260210",
    "date": "2026-02-10T00:00:00Z",
    "isSubmitted": true,
    "clientComment": "Tough day but got through it",
    "coachComment": "Great effort, keep it up!",
    "mood": 4,
    "goals": [ ... ],
    "summary": {
      "total": 15,
      "done": 9,
      "partial": 0,
      "pending": 6,
      "completionRate": 60
    }
  }
}
  • clientComment — your message when submitting the day (null if none)
  • coachComment — your coach’s reply (null if none)
  • mood — your mood rating when submitting (1–5, null if not set)

Monthly Targets

MethodPathDescription
GET/targetsList your monthly targets
GET/targets/:idGet a single target
POST/targetsCreate a target
PUT/targets/:idUpdate a target
DELETE/targets/:idDelete a target

Filter: ?month=YYYYMM, ?status=done|partial|pending

Create a target:

{
  "name": "Read 3 books",
  "month": "202603",
  "tag": "blue",
  "description": "Fiction or non-fiction",
  "rollOver": true,
  "yearlyTargetId": "abc123"
}
FieldRequiredDescription
nameYesTarget name
monthYesMonth in YYYYMM format
descriptionNoDescription text
tagNoColour name (e.g., red, blue, yellow)
rollOverNotrue to roll over incomplete targets to the next month
yearlyTargetIdNoID of a yearly target to link to (from /yearly-targets). Set to null to unlink.

All fields except name and month can also be updated via PUT.

Submitted months are read-only. Once a month has been submitted, its targets cannot be created, updated, or deleted via the API. You’ll receive a 409 response with code MONTH_SUBMITTED. You can still read targets in submitted months.


Yearly Targets

MethodPathDescription
GET/yearly-targetsList your yearly targets
GET/yearly-targets/:idGet a yearly target with linked monthly targets
POST/yearly-targetsCreate a yearly target
PUT/yearly-targets/:idUpdate a yearly target
DELETE/yearly-targets/:idDelete a yearly target

Create a yearly target:

{
  "name": "Run a marathon",
  "emoji": "🏃"
}

Both name and emoji are required. The emoji appears alongside linked monthly targets in the app.

Update via PUT — you can change name, emoji, isDone (boolean), and reflection (text). Setting isDone: true marks the yearly target as complete. Use reflection to add your thoughts when completing it — this appears in your chat history.

Delete removes the yearly target. Monthly targets that were linked to it will retain the yearlyTargetName and yearlyTargetEmoji they were created with, but the link becomes inactive.

The response for GET /yearly-targets/:id includes a linkedTargets array showing all monthly targets linked to it (via yearlyTargetId).


Months

MethodPathDescription
GET/monthsList your month submissions
GET/months/:YYYYMMMonth detail with targets and completion summary
POST/months/:YYYYMM/submitSubmit a month
POST/months/:YYYYMM/unsubmitUnsubmit a month

Submit/unsubmit works the same as days — optional comment and mood (1–5). You can only submit the current month or past months. Submitting locks the month’s targets.


Chat

Access your coaching chat history and send messages — including images.

MethodPathDescription
GET/chat/messagesList messages
GET/chat/messages/:idGet a single message
POST/chat/messagesSend a text message
POST/chat/messages/imageSend an image message

Filters: ?search=meditation, ?from=YYYY-MM-DD, ?to=YYYY-MM-DD, ?systemMessages=false

System messages (e.g. “Repeating goal added”) are included by default. Set ?systemMessages=false to hide them.

Messages with images include an image URL and isImageMessage: true in the response. The sentBy field shows the sender’s display name (not an internal ID).

Send a text message:

{ "text": "Had a great week!" }

Send an image: Use multipart/form-data with an image field. Optional text field for a caption.

curl -X POST "https://api.goalswon.com/api/v1/chat/messages/image" \
  -H "X-GoalsWon-Key: YOUR_API_KEY" \
  -F "image=@photo.jpg" \
  -F "text=Check out my progress!"

Image limits:

  • Max file size: 5MB
  • Supported formats: JPEG, PNG, GIF, WebP
  • Images are automatically resized (max 1000x1000) and compressed
  • Upload limit: 30 per hour, 100 per day

Inbox

Your inbox holds undated goals — ideas and tasks you haven’t scheduled yet.

MethodPathDescription
GET/inboxList inbox items
GET/inbox/:idGet a single inbox item
POST/inboxAdd an item to your inbox
PUT/inbox/:idUpdate an inbox item
POST/inbox/:id/scheduleSchedule — converts to a goal on a date
DELETE/inbox/:idDelete an inbox item

Filter: ?status=done|pending

Add an inbox item:

{
  "name": "Research holiday destinations",
  "description": "Look at flights and hotels",
  "tag": "cyan"
}

Only name is required. description and tag (colour name) are optional.

Update an inbox item — all fields are optional:

{
  "name": "Updated name",
  "description": "New description",
  "tag": "green",
  "isDone": true,
  "isPartiallyDone": false
}

Schedule an inbox item — assigns a date, converting it into a goal. The inbox item is removed.

POST /inbox/{id}/schedule
{
  "date": "2026-03-10"
}

date is optional — defaults to today (in your timezone). Returns the newly created goal.


Wins

MethodPathDescription
GET/winsList your wins

Returns your wins (previously called milestones), each with id, name, date, and emoji. The milestonesTotal counter in /me keeps its legacy name.


Progress Report

Get a summary of how you’re doing over any date range.

MethodPathDescription
GET/progressYour progress report (default: last 30 days)

Filters: ?from=YYYY-MM-DD, ?to=YYYY-MM-DD

Response includes:

  • Overview — total days, submitted days, goals done/partial/pending, completion rate, current streak
  • By tag — breakdown of completion rates per goal category
  • Daily rates — completion percentage for each day in the range

For Coaches

If your API key belongs to a coach account, three extra endpoints are available:

MethodPathDescription
GET/clientsList your clients
GET/clients/:idSingle client detail
GET/clients/:id/summaryClient summary — goals, recent chat, streaks

These return 403 for non-coach accounts.


MCP Server — Connect Your AI Assistant

The GoalsWon MCP server lets AI assistants read and manage your goals directly. It works with any tool that supports the Model Context Protocol — including Claude, Gemini, Cursor, Windsurf, and others.

Setup

  1. Install the MCP server:

    npm install -g @goalswon/mcp-server
  2. Add it to your AI assistant’s MCP configuration. The details vary by tool — here are some common ones:

    Claude Code:

    claude mcp add goalswon -- goalswon-mcp

    Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on Mac, %APPDATA%\Claude\claude_desktop_config.json on Windows):

    {
      "mcpServers": {
        "goalswon": {
          "command": "goalswon-mcp",
          "env": {
            "GOALSWON_API_KEY": "YOUR_API_KEY"
          }
        }
      }
    }

    Other tools: Check your tool’s documentation for how to add an MCP server. You’ll need to point it at the goalswon-mcp command with your API key as the GOALSWON_API_KEY environment variable.

  3. Your AI assistant can now access your GoalsWon data.

What Your AI Assistant Can Do

CapabilityDescription
List goalsSee your goals filtered by date and status
Create goalsAdd new goals for any date
Update goal statusMark goals as done, partial, or pending
View day detailsSee a full day with all goals and completion summary
Monthly & yearly targetsCreate, update, and track monthly and yearly targets
Recurring goalsSet up repeating goals (daily, weekly, etc.)
InboxManage undated goals and schedule them
Search chatSearch your coaching chat history
Send messagesSend a message to your coach
Progress reportGet completion rates, streaks, and trends
And more…Wins, submit days/months, upload images, etc.

Example

Ask your AI assistant things like:

  • “How did I do this week?”
  • “Create a goal ‘Morning run’ for tomorrow”
  • “Mark my meditation goal as done”
  • “What’s my current streak?”
  • “Search my chat for messages about sleep”
  • “Share my week themes with my coach”
  • “Post the workout screenshots”

CLI — Terminal Access

Manage your goals from the command line.

Install

npm install -g @goalswon/cli

Authenticate

goalswon auth login YOUR_API_KEY
goalswon auth status    # Verify it worked

Commands

# Your profile
goalswon auth status

# Goals
goalswon goals list --today                    # Today's goals
goalswon goals list --yesterday                # Yesterday's goals
goalswon goals list --tomorrow                 # Tomorrow's goals
goalswon goals list --date 2026-03-06          # Specific date
goalswon goals list --status pending           # Filter by status
goalswon goals create "Exercise" --today
goalswon goals complete <goalId>               # Mark done
goalswon goals complete <goalId> --status partial
goalswon goals delete <goalId>
goalswon goals recurring                       # Your recurring templates

# Days
goalswon days list --from 2026-03-01 --to 2026-03-31
goalswon days show --today                     # Today's detail with goals
goalswon days show --yesterday                 # Yesterday
goalswon days show 20260306                    # Specific date

# Monthly targets
goalswon targets list --month 202603
goalswon targets create "Read 3 books" --month 202603

# Chat
goalswon chat list --limit 10                  # Recent messages
goalswon chat list --search "meditation"       # Search your chat

# Progress
goalswon progress                              # Last 30 days
goalswon progress --from 2026-01-01 --to 2026-03-01

Security

  • Your API key gives access only to your own data
  • Keys are stored securely — we never see your raw key after creation
  • You can revoke any key at any time from Settings or via the API
  • All requests are encrypted via HTTPS

Need Help?