Skip to content

feat: Add POST /api/tasks endpoint for GitHub polling integration#5

Closed
tarasyarema wants to merge 1 commit intomainfrom
add-rest-api-tests
Closed

feat: Add POST /api/tasks endpoint for GitHub polling integration#5
tarasyarema wants to merge 1 commit intomainfrom
add-rest-api-tests

Conversation

@tarasyarema
Copy link
Contributor

Summary

Adds a REST API endpoint to create tasks via HTTP POST requests, enabling external services like GitHub issue monitors to create tasks directly in the swarm.

Changes

  • ✅ Import createTaskExtended from db module
  • ✅ Add POST /api/tasks endpoint with Bearer token authentication
  • ✅ Support all task creation options (tags, priority, taskType, dependsOn, etc.)
  • ✅ Return 201 Created with task object on success
  • ✅ Validate required 'task' field in request body
  • ✅ Proper error handling with 400/500 status codes

Integration

This endpoint enables the GitHub polling service to:

  • Create tasks for new issues with 'swarm' label
  • Create review tasks for new PRs
  • Create tasks for @swarm mentions in PR comments

Testing

  • Endpoint tested with curl and validated response format
  • Authentication tested with Bearer token
  • Integration tested with GitHub monitor script
  • All task creation options verified

Deployment

Once merged, the API server at api:3013 needs to be restarted to load this new endpoint.

🤖 Generated with Claude Code

Add REST API endpoint to create tasks via HTTP POST requests, enabling
external services like GitHub issue monitors to create tasks directly.

Changes:
- Import createTaskExtended from db module
- Add POST /api/tasks endpoint with Bearer token authentication
- Support all task creation options (tags, priority, taskType, etc.)
- Return 201 Created with task object on success
- Validate required 'task' field in request body

This endpoint is required for the GitHub polling service to create
tasks for new issues, PRs, and @swarm mentions in comments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Dec 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
agent-swarm Ready Ready Preview, Comment Dec 23, 2025 3:52pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants