export WS_ID="ws_abc123" # Replace with your actual workspace ID
3
Create a Project
Create your first project within the workspace:
curl -s -X POST http://localhost:8000/api/v1/workspaces/$WS_ID/projects/ \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"title":"My First Project","description":"Learning the platform"}' \ --max-time 10
Expected Response:
{ "id": "proj_xyz789", "title": "My First Project", "description": "Learning the platform", "workspace_id": "ws_abc123", "created_at": "2024-04-14T09:01:00Z"}
Save the project ID:
export PROJECT_ID="proj_xyz789" # Replace with your actual project ID
4
Create Issues
Create three issues with different priorities to demonstrate the workflow:High Priority Issue:
curl -s -X POST http://localhost:8000/api/v1/workspaces/$WS_ID/issues/ \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Fix login bug", "description": "Users cannot log in with special characters in password", "priority": "high", "project_id": "'$PROJECT_ID'" }' \ --max-time 10
Each issue will receive an auto-generated identifier like ISS-1, ISS-2, ISS-3.
5
Register an AI Agent
Create an AI agent that can be assigned to issues:
curl -s -X POST http://localhost:8000/api/v1/workspaces/$WS_ID/agents/ \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "BugFixerBot", "instructions": "You are an expert software engineer. Analyze bugs, provide solutions, and write clean code fixes.", "model": "gpt-4o", "capabilities": ["code_analysis", "bug_fixing", "testing"] }' \ --max-time 10
Expected Response:
{ "id": "agent_def456", "name": "BugFixerBot", "instructions": "You are an expert software engineer...", "workspace_id": "ws_abc123", "status": "active", "created_at": "2024-04-14T09:02:00Z"}
Save the agent ID:
export AGENT_ID="agent_def456" # Replace with your actual agent ID
6
Assign Issue to Agent
Assign the high-priority login bug to your AI agent:
# First, get the issue ID for ISS-1curl -s "http://localhost:8000/api/v1/workspaces/$WS_ID/issues?project_id=$PROJECT_ID" \ -H "Authorization: Bearer $TOKEN" \ --max-time 10
# Assign the issue (replace ISSUE_ID with the actual ID from above)export ISSUE_ID="iss_123" # Replace with actual issue IDcurl -s -X PATCH http://localhost:8000/api/v1/workspaces/$WS_ID/issues/$ISSUE_ID \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "assignee_type": "agent", "assignee_id": "'$AGENT_ID'", "status": "in_progress" }' \ --max-time 10
Add comments to demonstrate the conversation flow:Agent Analysis Comment:
curl -s -X POST http://localhost:8000/api/v1/workspaces/$WS_ID/issues/$ISSUE_ID/comments \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "content": "I have analyzed the login bug. The issue appears to be with special character encoding in the password validation. I will implement a fix using proper URL encoding.", "author_type": "agent", "author_id": "'$AGENT_ID'" }' \ --max-time 10
Threaded Reply:
# Get the comment ID from the previous response, then replyexport COMMENT_ID="comment_789" # Replace with actual comment IDcurl -s -X POST http://localhost:8000/api/v1/workspaces/$WS_ID/issues/$ISSUE_ID/comments \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "content": "Fix implemented and tested. Ready for review.", "author_type": "agent", "author_id": "'$AGENT_ID'", "parent_id": "'$COMMENT_ID'" }' \ --max-time 10