Skip to content

Quickstart in 5 minutes

You need to be a workspace admin or owner and be on a paid plan (or be a client funded by your agency).

  1. Create the key. In Preflow, open Settings → Integrations → API & webhooks, click to create a key, give it a name (for example ERP) and select the scopes your integration needs. No scope is required for this test.

  2. Store the key. It is shown only once. Copy it and store it in the secret vault of the server that will call the API. In your terminal, for the test:

    Janela do terminal
    export PREFLOW_API_KEY="pf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  3. Make your first call. GET /v1/me tells you which workspace the key belongs to, which scopes it has and its request limit:

    Janela do terminal
    curl https://api.preflow.sale/v1/me -H "Authorization: Bearer $PREFLOW_API_KEY"
    {
    "api_version": "v1",
    "workspace": { "id": "6c1f…", "name": "My Company" },
    "api_key": { "id": "0b9e…", "name": "ERP", "environment": "live", "scopes": [] },
    "limits": { "requests_per_minute": 600 }
    }
  4. Pick your next step. Add the scopes for what you’re going to build and follow the guide: WhatsApp, Leads, accounts and cadences or Webhooks.

Response What to do
401 authentication_required The Authorization: Bearer … header is missing
401 invalid_api_key Check that you copied the whole key and that you’re using the right environment (Environments)
403 plan_upgrade_required The workspace’s plan doesn’t include the API; once you subscribe, the same key works again

Every code is listed in Errors.