Skip to content
Pitchlane API

Guide

Authentication

Create an API key in the Pitchlane app and send it with every request in the X-API-Key header.

Every request to the Pitchlane API is made as a Pitchlane user, identified by an API key. The API is available on every Pitchlane plan.

Create an API key

  1. Sign in to the Pitchlane app.
  2. Open the account menu and choose Profile.
  3. In the API Keys section, click Create API Key and give it a description, such as the name of the system that will use it.

A key acts as the user who created it: it can read and change that user’s campaigns, videos, media and webhook subscriptions. Keys do not expire. To revoke one, delete it in the same API Keys section; requests sent with it are refused from then on.

Treat a key like a password. Keep it on your server or in your automation tool’s secret storage, and never put it in a web page or a mobile app that you ship to other people.

Send the key with each request

Send the key in the X-API-Key header. All endpoints live under the base URL https://api.pitchlane.com/api/public/v1.

curl https://api.pitchlane.com/api/public/v1/me \
  -H "X-API-Key: $PITCHLANE_API_KEY"

GET /me answers with the user, organisation and plan the key belongs to, so it is a quick way to check a key works.

The API also reads the key from an apiKey query parameter, but prefer the header: URLs end up in logs and browser histories.

When the key is missing or wrong

A request without a key, or with a key that does not exist (or was deleted), is answered 401 in the API’s usual error shape:

{
  "error": {
    "code": "unauthorized",
    "message": "You are not logged in"
  }
}

Branch on error.code, not on the message: codes are stable, messages are written for people and may change.

Limits

Each account may send 3000 read requests (GET) and 1200 write requests (everything else) per minute. Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset headers. Over the limit the API answers 429 with a Retry-After header (in seconds). The API reference describes these, idempotency keys and the full list of error codes in its introduction.