Missions API Guide

Manage missions programmatically using the TeamDay REST API. All endpoints require authentication via a Personal Access Token (PAT).

Base URL: https://cc.teamday.ai/api/v1/missions


Authentication

All requests require a Bearer token:

-H "Authorization: Bearer $TEAMDAY_API_TOKEN"

See API Keys & Authentication for how to create tokens.


Create a Mission

POST /api/v1/missions

Request Body

FieldTypeRequiredDescription
titlestringYesMission title
goalstringYesInstructions for the agent
iconstringNoEmoji icon (default: 🎯)
spaceIdstringNoSpace to run in
characterIdstringNoAgent to run as (the agent’s ID)
agentTypestringNoProvider: claude, gemini, codex (default: claude)
visibilitystringNoprivate, organization, public (default: private)
scheduleobjectYesSchedule configuration

Schedule Object

FieldTypeDescription
typestringnone, once, cron, continuous
valuestringCron expression (required for cron type)

Example

curl -X POST "https://cc.teamday.ai/api/v1/missions" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Daily Analytics Report",
    "goal": "Pull yesterday Google Analytics data and save a summary to reports/daily/",
    "spaceId": "abc123",
    "characterId": "def456",
    "schedule": {
      "type": "cron",
      "value": "0 8 * * *"
    }
  }'

Response

{
  "success": true,
  "id": "mission-xyz789",
  "title": "Daily Analytics Report",
  "status": "pending",
  "schedule": {
    "type": "cron",
    "value": "0 8 * * *",
    "lastRun": null,
    "nextRun": "2026-02-20T08:00:00.000Z",
    "runCount": 0,
    "maxRuns": null
  }
}

Update a Mission

PATCH /api/v1/missions/:id

Request Body

All fields are optional. Only provided fields are updated.

FieldTypeDescription
titlestringUpdated title
goalstringUpdated instructions
iconstringUpdated emoji icon
characterIdstring or nullChange or remove agent (the agent’s ID; null to unbind)
statusstringpending, running, paused, completed, failed
scheduleobjectUpdated schedule (partial merge with existing)

Examples

Pause a mission:

curl -X PATCH "https://cc.teamday.ai/api/v1/missions/mission-xyz789" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status": "paused"}'

Change schedule:

curl -X PATCH "https://cc.teamday.ai/api/v1/missions/mission-xyz789" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "schedule": {
      "type": "cron",
      "value": "0 9 * * 1-5"
    }
  }'

Update goal and resume:

curl -X PATCH "https://cc.teamday.ai/api/v1/missions/mission-xyz789" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "goal": "Updated instructions with more detail...",
    "status": "pending"
  }'

Response

{
  "success": true,
  "id": "mission-xyz789",
  "updated": ["goal", "status"]
}

TeamdayAdmin Tool

Missions can also be managed from within a conversation using the TeamdayAdmin MCP tool.

Create

{
  "action": "createMission",
  "data": {
    "title": "Weekly Report",
    "goal": "Generate the weekly performance report.",
    "spaceId": "abc123",
    "schedule": { "type": "cron", "value": "0 9 * * MON" }
  }
}

Update

{
  "action": "updateMission",
  "resourceId": "mission-xyz789",
  "data": {
    "status": "paused"
  }
}

List

{
  "action": "listMissions"
}

Delete

{
  "action": "deleteMission",
  "resourceId": "mission-xyz789"
}

Cron Expression Reference

ExpressionSchedule
0 8 * * *Daily at 8:00 AM
0 9 * * MONMondays at 9:00 AM
0 9 * * 1-5Weekdays at 9:00 AM
0 */6 * * *Every 6 hours
0 9 1 * *1st of each month at 9:00 AM
0 9 1 1,4,7,10 *Quarterly (Jan, Apr, Jul, Oct)
*/30 * * * *Every 30 minutes

Format: minute hour day-of-month month day-of-week


Error Responses

Validation Error (400)

{
  "statusCode": 400,
  "message": "Validation error",
  "data": [
    { "path": ["title"], "message": "Required" }
  ]
}

Not Found (404)

{
  "statusCode": 404,
  "message": "Mission not found"
}

Unauthorized (401)

{
  "statusCode": 401,
  "message": "Invalid or expired token"
}

Forbidden (403)

{
  "statusCode": 403,
  "message": "Access denied to this mission"
}

Next Steps