Missions API Guide
Manage missions programmatically using the TeamDay REST API. All endpoints require authentication via a Personal Access Token (PAT).
Base URL: https://us.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
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Mission title |
goal | string | Yes | Instructions for the agent |
icon | string | No | Emoji icon (default: 🎯) |
spaceId | string | No | Space to run in |
characterId | string | No | Character to run as |
agentType | string | No | Provider: claude, gemini, codex (default: claude) |
visibility | string | No | private, organization, public (default: private) |
schedule | object | Yes | Schedule configuration |
Schedule Object
| Field | Type | Description |
|---|---|---|
type | string | none, once, cron, continuous |
value | string | Cron expression (required for cron type) |
Example
curl -X POST "https://us.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.
| Field | Type | Description |
|---|---|---|
title | string | Updated title |
goal | string | Updated instructions |
icon | string | Updated emoji icon |
characterId | string or null | Change or remove character (null to unbind) |
status | string | pending, running, paused, completed, failed |
schedule | object | Updated schedule (partial merge with existing) |
Examples
Pause a mission:
curl -X PATCH "https://us.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://us.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://us.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
| Expression | Schedule |
|---|---|
0 8 * * * | Daily at 8:00 AM |
0 9 * * MON | Mondays at 9:00 AM |
0 9 * * 1-5 | Weekdays 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
- Missions User Guide — Concepts and examples
- API Keys & Authentication — Set up API tokens
- CLI Tool — Manage missions from the command line