Skip to content

API and MCP

Build on Piqline

The tools and agents of your workspace, over HTTP or MCP. One key, scopes, readable errors.

  • 92 tools
  • 7 agents
  • 5 scopes
  • REST and MCP

Your first call

curl -s https://piqline.com/api/v1/workspace \
  -H "Authorization: Bearer $PIQLINE_API_KEY"
Response
{
  "workspace": { "id": "b7a1c3e0-5d2f-4c8a-9e41-2f6d0a7b1c93", "name": "Atelier" },
  "key": { "name": "Claude Code", "prefix": "piq_live_Ab12Cd", "scopes": ["read", "agents"] },
  "limits": { "requests_per_minute": 120, "requests_today": 1 }
}

Where to start

The Piqline API gives your scripts and agents access to your workspace: the same tools and the same agents as the dashboard assistant, over HTTP or MCP (Model Context Protocol). Each call acts on one workspace, with the rights of the member who created the key.

What you need#

  • A Piqline workspace where you are owner or admin. Members see the keys page read-only.
  • A tool that sends HTTP requests (curl in the examples) or an MCP client.

1. Create a key#

  1. Open Settings → API and MCP.
  2. Name the key, tick its scopes (start with read) and pick an expiry.
  3. Click Create key, then copy the key. It is shown only once.

Store it in an environment variable:

Shell
export PIQLINE_API_KEY="piq_live_…"

2. Verify the key#

curl -s https://piqline.com/api/v1/workspace \
  -H "Authorization: Bearer $PIQLINE_API_KEY"

Response:

JSON
{
  "workspace": { "id": "b7a1c3e0-5d2f-4c8a-9e41-2f6d0a7b1c93", "name": "Atelier" },
  "key": {
    "id": "0d4e8f2a-71c6-4b3d-8a55-c9e2b6f10d47",
    "name": "Claude Code",
    "prefix": "piq_live_Ab12Cd",
    "scopes": ["read", "agents"]
  },
  "acting_as": {
    "user_id": "3c9a52e1-8b47-4d06-a2f3-71e0b5d4c689",
    "email": "you@example.com",
    "role": "owner"
  },
  "limits": {
    "requests_per_minute": 120,
    "agent_runs_per_minute": 10,
    "requests_per_day": 20000,
    "requests_today": 1
  }
}

key.scopes lists what the key can do, and limits what it has left. A 401 means the key is missing, miscopied or revoked: see Errors.

3. Call a tool#

A tool is one capability of the assistant: read the corpus, search live, write, act. This example reads the collection volumes of the last 7 days:

curl -s https://piqline.com/api/v1/tools/getCoverageStats \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"period":"7d"}'

The response carries the tool name and its output (shortened here):

JSON
{
  "tool": "getCoverageStats",
  "output": {
    "period": "7d",
    "itemsTotal": 1842,
    "itemsPeriod": 214,
    "items24h": 37,
    "sources": 12,
    "byPlatform": [{ "platform": "rss", "items": 904, "items24h": 20 }]
  }
}

The 92 callable tools, their scopes and their inputs are listed in the catalog.

4. Ask an agent#

An agent chains several tools and answers in natural language. The key needs the agents scope, plus the scopes of the tools the agent may use.

curl -s https://piqline.com/api/v1/agents/piqline \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"How many sources does this workspace follow, and which ones are failing?"}'

Response, shortened:

JSON
{
  "agent": "piqline",
  "status": "completed",
  "text": "The workspace follows 12 sources, 2 of them failing: …",
  "tool_calls": [{ "tool": "listSources", "state": "output-available" }],
  "pending": []
}

More in Agents.

5. Connect an MCP client#

With Claude Code:

Shell
claude mcp add --transport http piqline https://piqline.com/api/mcp \
  --header "Authorization: Bearer $PIQLINE_API_KEY"

Other clients are covered in MCP server.

Not yet available#

  • Webhooks. Nothing is pushed to your systems. To follow what comes in, poll getSignals or searchItems at a regular interval.
  • Official SDKs. The OpenAPI document describes every route: a client generator turns it into an SDK in your language.
  • OAuth sign-in. Only keys are accepted. Connectors that require OAuth, such as those of claude.ai and ChatGPT, cannot connect yet.
  • Bulk export. Tools return bounded result pages (at most 40 items for searchItems).

A question about the API, or a mistake on this page? Write to us.