Skip to main content

← All docs

REST API reference

The public API lets agents and external systems read and write a workspace's CRM data. Everything is scoped to the workspace that owns the API key.

Base URL

https://edenclick.pamanix.workers.dev/api/v1

Authentication

Authenticated endpoints use a Bearer API key. Create keys in the app underSettings → API keys. Keys are hashed at rest and can be scoped to read-only or read/write.

Authorization: Bearer tcr_xxxx
401Missing or invalid key
403Key lacks the required scope
429Rate limited

The /track endpoint is unauthenticated — it uses a workspace tracking ID from the JavaScript snippet instead.

Conversion tracking

Send a conversion from any site or backend. Upserts the contact by email and, when an amount is present, creates a deal.

POST /trackno auth
curl -X POST https://edenclick.pamanix.workers.dev/api/v1/track \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "t_XXXX",              // workspace tracking ID
    "email": "alice@example.com",
    "name": "Alice",
    "amount": 2450.00,           // optional
    "currency": "KES",           // optional, ISO 4217
    "externalId": "INV-123",     // optional reference
    "status": "processing",      // optional
    "goal": "purchase",          // purchase | signup | lead | trial
    "site": "example.com",
    "clickParams": "?utm_source=partner",   // optional attribution
    "tcr": "..."                 // optional attribution event ID
  }'

Contacts

GET /contacts

Query params: email, search, site

POST /contacts

Body: name*, email*, phone, title,companyName, notes, source, lifecycleStage,site, clickParams, tcr. Upserts by email.

GET /contacts/:id

PATCH /contacts/:id

Update any contact field; companyName finds or creates the company.

DELETE /contacts/:id

Deals

GET /deals

Query param: contactId

POST /deals

Body: contactId*, title*, value, currency,stage, notes, site, goal, clickParams, tcr.

GET /deals/:id · PATCH /deals/:id · DELETE /deals/:id

PATCH /deals/:id/stage

Body: {"stage":"Won"}. Stages: Lead_In, Proposal_Sent, Negotiating, Won, Lost.

Companies

GET /companies (search), POST /companies, GET /companies/:id, PATCH /companies/:id, DELETE /companies/:id.

Partners

GET /partners (search, status), POST /partners, GET /partners/:id, PATCH /partners/:id, DELETE /partners/:id.

Links

GET /links (search), POST /links, GET /links/:id, PATCH /links/:id, DELETE /links/:id.

POST /links
curl -X POST https://edenclick.pamanix.workers.dev/api/v1/links \
  -H "Authorization: Bearer tcr_xxxx" -H 'Content-Type: application/json' \
  -d '{ "slug": "jane", "targetUrl": "https://example.com", "partnerName": "Jane Doe" }'

Workspace

GET /workspace returns the current workspace: id, slug, name,trackingId, timezone, domainLabels.

Errors

{ "error": "validation_failed", "issues": [...] }

Invalid JSON returns 400 with {"error":"invalid_json"}. Validation errors include a Zod issue tree under issues.