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 (
curlin the examples) or an MCP client.
1. Create a key#
- Open Settings → API and MCP.
- Name the key, tick its scopes (start with
read) and pick an expiry. - Click Create key, then copy the key. It is shown only once.
Store it in an environment variable:
export PIQLINE_API_KEY="piq_live_…"2. Verify the key#
curl -s https://piqline.com/api/v1/workspace \
-H "Authorization: Bearer $PIQLINE_API_KEY"const response = await fetch("https://piqline.com/api/v1/workspace", {
headers: { Authorization: "Bearer " + process.env.PIQLINE_API_KEY },
});
const data = await response.json();import os
import requests
response = requests.get(
"https://piqline.com/api/v1/workspace",
headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
)
data = response.json()Response:
{
"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"}'const response = await fetch("https://piqline.com/api/v1/tools/getCoverageStats", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ period: "7d" }),
});
const data = await response.json();import os
import requests
response = requests.post(
"https://piqline.com/api/v1/tools/getCoverageStats",
headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
json={"period": "7d"},
)
data = response.json()The response carries the tool name and its output (shortened here):
{
"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?"}'const response = await fetch("https://piqline.com/api/v1/agents/piqline", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ input: "How many sources does this workspace follow, and which ones are failing?" }),
});
const data = await response.json();import os
import requests
response = requests.post(
"https://piqline.com/api/v1/agents/piqline",
headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
json={"input": "How many sources does this workspace follow, and which ones are failing?"},
)
data = response.json()Response, shortened:
{
"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:
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
getSignalsorsearchItemsat 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).