Home/
Developer Portal

Getting Started

Go from zero to your first API call in 5 steps. This quickstart assumes you have an Enterprise-tier Sergio account.

1

Get Your API Key

Navigate to your Sergio dashboard and generate an API key. You must be on the Enterprise tier (15+ users) to access the API.

Keep your API key secret. Never commit it to version control or expose it in client-side code. Use environment variables instead.

2

Make Your First Request

Test your API key with a simple curl request to the health endpoint:

terminal
bash
curl -X GET https://api.sergio.app/v1/health \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"

Expected response:

json
{
  "status": "ok",
  "version": "1.0.0",
  "timestamp": "2026-01-30T12:00:00Z"
}
3

Authenticate

The main API uses JWT bearer token authentication. Exchange your credentials for a token:

terminal
bash
curl -X POST https://api.sergio.app/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "admin@yourcompany.com",
    "password": "your-password"
  }'

Use the returned JWT token in the Authorization: Bearer header for all subsequent requests.

4

Create a Job

Schedule your first window cleaning job via the API:

terminal
bash
curl -X POST https://api.sergio.app/v1/jobs \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cust_def456",
    "service_type": "exterior_windows",
    "scheduled_date": "2026-02-15",
    "scheduled_time": "09:00",
    "address": {
      "street": "123 Oak Street",
      "city": "Portland",
      "state": "OR",
      "zip": "97201"
    }
  }'
5

Set Up Webhooks

Register a webhook endpoint to receive real-time event notifications. Sergio will send POST requests to your URL when events occur.

terminal
bash
curl -X POST https://api.sergio.app/v1/webhooks \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://yourserver.com/webhooks/sergio",
    "events": ["job.created", "job.completed", "invoice.paid"],
    "secret": "your-webhook-secret"
  }'

You're all set!

You've authenticated, created a job, and registered for webhooks. Explore the full API reference or check out the SDK documentation for your language of choice.