Connect API

One click from any platform.

OAuth for consent, a Bearer token for uploads and links, HMAC webhooks when someone reads the brochure. PrepCRM is one client; anything that can redirect and POST JSON works the same way.

1. Register an app

In a Prepinfo workspace open Settings → CRM connection and generate a client ID and secret. Add your CRM’s callback URL (for PrepCRM that is /api/prepinfo/callback). Paste the three values into the CRM.

2. Send people to authorize

Prefill org_name, slug, email and name so they can create a workspace in the same step.

https://prepseed.com/connect/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=https://yourapp.com/callback&state=CSRF&scope=documents%3Awrite%20links%3Awrite%20analytics%3Aread%20webhooks%3Awrite

3. Exchange the code

POST https://prepseed.com/api/oauth/token with grant_type=authorization_code, code, client_id, client_secret, redirect_uri. You get access_token, org_id, org_slug. Store the token; it is shown once.

4. REST

Header Authorization: Bearer pi_live_…

  • POST /api/v1/documents/upload-url — presign
  • PUT the file to uploadUrl, then POST /api/v1/documents
  • POST /api/v1/documents/:id/links — pass externalId (your lead id)
  • GET /api/v1/documents/:id/analytics
  • PUT /api/v1/webhook — url + events; secret returned on first save

5. Webhooks

Events: link.opened, session.updated, link.revoked. Header X-Prepinfo-Signature: t=unix,v1=hmac_sha256(secret, t.body). Reject if |now − t| > 5 minutes. Match a reader to your CRM row with data.external_id, else phone/email on data.recipient.

Scopes: documents:write, links:write, analytics:read, webhooks:write. Tenant is always the token — never an org id in the body.