Getting started
Authentication
API keys, the Authorization header and agent attribution.
API keys
Every request to the gateway, REST or MCP, carries an API key from Dashboard → API keys. Keys look like pl_live_ followed by 32 random characters and belong to one workspace.
Header
Authorization: Bearer pl_live_…- The full key is shown once, when you create it. Portless stores only a hash, so it can't show it again.
- Revoking a key takes effect on the next request.
- The dashboard shows when each key was last used, so stale keys are easy to spot.
Check a key
GET /api/v1/me tells you which workspace and key a request authenticated as. It's a good first call in a new integration.
curl
curl https://www.initpbj.dev/api/v1/me -H "Authorization: Bearer $PORTLESS_API_KEY"
{ "workspace": "Personal", "key": { "id": "…", "name": "CI" }, "agentId": null }Agent attribution
Create agents in Dashboard → Agents, then say which agent is calling. Activity and the overview charts break calls down by agent.
- Header, on any request:
X-Portless-Agent: Release bot. The value can be the agent's name (not case sensitive) or its id. - REST tool calls can also pass
"agent": "Release bot"in the body, which wins over the header. - Unknown agent names are ignored: the call still runs, it just isn't attributed.
Keeping keys safe
- Use one key per app or environment, so you can revoke one without breaking the others.
- Load keys from environment variables or a secret manager. Never commit them.
- Don't ship a key to a browser or mobile app: anyone can read it there. Call the gateway from your server instead.
Leaked a key?
Revoke it in Dashboard → API keys right away, then create a new one. Revoked keys stop working immediately.
Error responses for authentication are listed in Errors.