# POST /service-requests

**Resource:** [Service Requests](./service-requests.md)  
**Scopes:** `service-requests:write`  
**Write operation:** yes

Submit a platform improvement request. Stores the request, sends a Slack notification to the engineering team, and returns the created record. Now accepts an optional related_ids array to link this request to existing requests at creation time (two-way symmetry is maintained automatically).

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `title` | body | string | yes | Brief summary of the improvement needed (max 200 chars) |
| `description` | body | string | yes | Detailed explanation: what you tried, what happened, what should happen instead (max 50000 chars) |
| `category` | body | string | no | Category: missing_tool, missing_field, missing_filter, better_errors, new_capability, workflow_improvement, documentation, bug_report, other |
| `affected_tools` | body | string[] | no | Array of MCP tool names or API endpoints affected, e.g. ["list_opportunities", "GET /opportunities"] |
| `suggested_solution` | body | string | no | What you wish existed from the API/MCP consumer perspective |
| `use_case` | body | string | no | The real-world user task that triggered this request |
| `priority` | body | string | no | Priority: low, medium, high, critical |
| `related_ids` | body | string[] | no | UUIDs of existing service requests to link to this one. Must belong to the same company. Two-way links are created automatically. |

## Request example

```bash
curl -X POST https://ucqwijexmjctglmrxlej.supabase.co/functions/v1/api/v1/service-requests \
  -H "Authorization: Bearer tp_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Add status filter to list_opportunities",
    "description": "Cannot filter opportunities by status (won/lost/open). Had to fetch all opportunities and filter client-side.",
    "category": "missing_filter",
    "affected_tools": ["list_opportunities"],
    "suggested_solution": "Add a status query parameter to GET /opportunities",
    "use_case": "User asked for a report of won deals from last quarter",
    "priority": "medium",
    "related_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]
  }'
```

## Response example

```json
{
  "data": {
    "id": "f112de7b-c7df-4193-bacd-2d43c31c1f11",
    "title": "Add status filter to list_opportunities",
    "description": "Cannot filter opportunities by status (won/lost/open)...",
    "context": {
      "source": "api",
      "category": "missing_filter",
      "priority": "medium",
      "affected_tools": ["list_opportunities"],
      "suggested_solution": "Add a status query parameter to GET /opportunities",
      "use_case": "User asked for a report of won deals from last quarter"
    },
    "status": "pending",
    "related_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"],
    "created_at": "2026-04-19T05:08:56.498025+00:00"
  },
  "meta": {
    "credits_remaining": 3457,
    "url": "https://app.trustpager.com/settings/service-requests",
    "message": "Service request logged. The customer can track all requests at the URL above."
  }
}
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`