Tickets

Create, list, and manage bug tickets via the API.

Tickets Endpoints

Tickets are the core resource in BugToMe. Use these endpoints to create, read, update, and manage bug reports.

List Tickets

Retrieve a list of tickets for a specific organization and project.

GET /api/v1/mcp/organizations/:organization_id/tickets

Query Parameters

Parameter Type Description
project_id UUID Filter by project (optional)
status String Filter by status: open, in_progress, resolved, closed
priority String Filter by priority: low, medium, high, critical
page Integer Page number (default: 1)
per_page Integer Items per page (default: 25, max: 100)

Response

{
  "tickets": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "title": "Login button not responding",
      "code": "PROJ-42",
      "status": "open",
      "priority": "high",
      "given": "User is on the login page",
      "when": "User clicks the login button",
      "then": "Nothing happens, page doesn't respond",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "meta": {
    "total": 150,
    "page": 1,
    "per_page": 25
  }
}

Create Ticket

Create a new ticket in a project. Requires a project API token or personal API token with access to the project.

POST /api/v1/tickets

Request Body

{
  "ticket": {
    "title": "Login button not responding",
    "given": "User is on the login page with valid credentials",
    "when": "User clicks the login button",
    "then": "Nothing happens, the page doesn't respond to the click",
    "priority": "high",
    "notes": "Tested on Chrome 120, Windows 11"
  }
}

Required Fields

Field Type Description
title String Short description of the bug (max 200 chars)
given String Initial state/context (Given-When-Then format)
when String Action that triggers the bug
then String Expected vs actual behavior

Optional Fields

Field Type Description
priority String low, medium, high, critical (default: medium)
notes String Additional context or reproduction steps

Response

{
  "ticket": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "code": "PROJ-43",
    "title": "Login button not responding",
    "status": "open",
    "priority": "high",
    "given": "User is on the login page with valid credentials",
    "when": "User clicks the login button",
    "then": "Nothing happens, the page doesn't respond to the click",
    "notes": "Tested on Chrome 120, Windows 11",
    "created_at": "2024-01-15T12:00:00Z"
  }
}

Example: Create Ticket with cURL

curl -X POST "https://bugto.me/api/v1/tickets" \
  -H "Authorization: Bearer proj_your_project_token" \
  -H "Content-Type: application/json" \
  -d '{
    "ticket": {
      "title": "Login button not responding",
      "given": "User is on the login page",
      "when": "User clicks the login button",
      "then": "Nothing happens"
    }
  }'