cURL examples

cURL one-liners for quick probing and scripts.

Shell setup

export AIGEON_API_KEY=sk_...
export AIGEON_BASE=https://api.aigeon.ai

Health check

curl "$AIGEON_BASE/health"
# {"code":0,"status":"success","message":"ok","data":"ok"}

Verify your API key

curl "$AIGEON_BASE/public/api/v1/token/check" \
  -H "X-Api-Token: $AIGEON_API_KEY"

Successful keys return code: 200 and the organization_id they're bound to.

Add a contact

curl -X POST "$AIGEON_BASE/public/api/v1/contacts/add-group-members" \
  -H "X-Api-Token: $AIGEON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "group_id": "sg_abc123",
    "members": [{"email": "alice@example.com", "first_name": "Alice"}]
  }'

Send through a flow

curl -X POST "$AIGEON_BASE/public/api/v1/flow/send-email-through-flow" \
  -H "X-Api-Token: $AIGEON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "flow_id": "flw_welcome",
    "contact_email": "alice@example.com",
    "context": { "order_id": "ord_123" }
  }'

Pull analytics

curl -G "$AIGEON_BASE/public/api/v1/analytics/metrics/get-email-event-metric" \
  -H "X-Api-Token: $AIGEON_API_KEY" \
  --data-urlencode "event_name=emailClick" \
  --data-urlencode "start_date=2026-04-01" \
  --data-urlencode "end_date=2026-04-30"

Debug an unexpected response

Add -i (show response headers) and --fail-with-body (print body on HTTP errors):

curl -i --fail-with-body ...
© Aigeon.ai 2025
All Rights Reserved