Reference
REST API
Every /api/v1 endpoint with request and response shapes.
All endpoints live under https://www.initpbj.dev/api/v1, take and return JSON, need an API key, and are never cached. Errors use one shape, described in Errors.
| Endpoint | Purpose |
|---|---|
GET /api/v1/me | Workspace and key for this request |
GET /api/v1/servers | List upstream servers |
POST /api/v1/servers/:id/sync | Import a server's current tools |
GET /api/v1/tools | List tools |
POST /api/v1/tools/call | Call a tool |
POST /api/v1/mcp | MCP endpoint |
Get the current key
GET
/api/v1/meResponse · 200
{
"workspace": "Personal",
"key": {
"id": "6f1c…",
"name": "CI"
},
"agentId": null
}agentId is set when the request names a known agent with X-Portless-Agent.
List servers
GET
/api/v1/serverscurl
curl https://www.initpbj.dev/api/v1/servers -H "Authorization: Bearer $PORTLESS_API_KEY"Response · 200
{
"servers": [
{
"id": "c26b0e45-…",
"name": "GitHub",
"namespace": "github",
"transport": "http",
"endpoint": "https://api.githubcopilot.com/mcp/",
"status": "healthy",
"credentialHeaders": [
"Authorization"
],
"createdAt": "2026-12-03T15:01:04.919Z"
}
]
}| Field | Notes |
|---|---|
transport | http (Streamable HTTP), sse, or stdio |
status | healthy, degraded or offline, updated from real calls |
credentialHeaders | Names of saved credential headers. Values are never returned. |
Sync a server's tools
POST
/api/v1/servers/:id/syncAsks the server for its tool list. New tools are added and turned on; existing tools get fresh descriptions. Tools you turned off stay off. Tools the server no longer lists are reported in missing and kept.
curl
curl -X POST https://www.initpbj.dev/api/v1/servers/<id>/sync -H "Authorization: Bearer $PORTLESS_API_KEY"Response · 200
{
"server": "github",
"added": [
"github.list_branches"
],
"updated": [
"github.get_issue",
"github.create_issue"
],
"missing": []
}List tools
GET
/api/v1/tools?enabled=trueLeave out enabled=true to include tools that are turned off.
Response · 200
{
"tools": [
{
"id": "9a3e…",
"name": "create_issue",
"description": "Open a new issue",
"enabled": true,
"tool": "github.create_issue",
"server": {
"id": "c26b…",
"namespace": "github",
"name": "GitHub",
"transport": "http",
"status": "healthy"
}
}
]
}Call a tool
POST
/api/v1/tools/callBody
| Field | Type | Notes |
|---|---|---|
tool | string | Required. namespace.tool, or the MCP form namespace__tool. |
arguments | object | Optional. The tool's input; must be a JSON object. |
agent | string | Optional. Agent name or id; overrides X-Portless-Agent. |
curl
curl https://www.initpbj.dev/api/v1/tools/call -H "Authorization: Bearer $PORTLESS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tool": "github.get_issue", "arguments": {"repo": "acme/app", "number": 42}, "agent": "Triage bot"}'Response · 200
{
"tool": "github.get_issue",
"latencyMs": 412,
"result": {
"content": [
{
"type": "text",
"text": "#42 Login fails on Safari…"
}
]
}
}result is the MCP CallToolResult exactly as the server returned it: content blocks (text, images, resources), and optionally structuredContent.
Tool failed? Still 200.
When the tool ran but reported a failure, the response is
200 with result.isError: true, and the call is logged as an error. Always check it. HTTP errors mean the gateway couldn't run the tool at all.