API Documentation

    Complete reference with interactive examples

    API Status

    Getting Started

    Authentication and base URL information

    Base URL

    https://api.salesos.com

    Authentication

    Include your API key in the request header:

    X-API-Key: your-api-key

    Rate Limits

    Rate limits vary by plan. Check response headers for your current usage:

    • X-RateLimit-Remaining - Requests remaining
    • X-RateLimit-Reset - Reset timestamp
    GET
    /api/leads

    Get Leads

    Retrieve all leads with optional filtering

    Query Parameters

    NameTypeDescription
    industry
    string
    Filter by industry
    limit
    number
    Number of results (default: 50)
    offset
    number
    Pagination offset

    Response

    Status: 200
    {
      "data": [
        {
          "id": "uuid",
          "contact_name": "John Doe",
          "company_name": "Acme Inc",
          "contact_email": "john@acme.com",
          "industry": "Technology",
          "icp_score": 85
        }
      ],
      "count": 1
    }

    Code Examples

    // GET Request
    const response = await fetch('https://api.salesos.com/api/leads', {
      method: 'GET',
      headers: {
        'X-API-Key': 'your-api-key',
        'Content-Type': 'application/json',
      },
    });
    
    const data = await response.json();
    console.log(data);
    POST
    /api/leads

    Create Lead

    Create a new lead

    Request Body

    {
      "contact_name": "John Doe",
      "company_name": "Acme Inc",
      "contact_email": "john@acme.com",
      "industry": "Technology"
    }

    Response

    Status: 201
    {
      "id": "uuid",
      "contact_name": "John Doe",
      "company_name": "Acme Inc",
      "created_at": "2025-01-11T10:30:00Z"
    }

    Code Examples

    // POST Request
    const response = await fetch('https://api.salesos.com/api/leads', {
      method: 'POST',
      headers: {
        'X-API-Key': 'your-api-key',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
      "contact_name": "John Doe",
      "company_name": "Acme Inc",
      "contact_email": "john@acme.com",
      "industry": "Technology"
    }),
    });
    
    const data = await response.json();
    console.log(data);
    GET
    /api/deals

    Get Deals

    Retrieve deals with filtering options

    Query Parameters

    NameTypeDescription
    stage
    string
    Filter by deal stage
    minValue
    number
    Minimum deal value

    Response

    Status: 200
    {
      "data": [
        {
          "id": "uuid",
          "title": "Enterprise Deal",
          "value": 50000,
          "stage": "negotiation",
          "probability": 75
        }
      ]
    }

    Code Examples

    // GET Request
    const response = await fetch('https://api.salesos.com/api/deals', {
      method: 'GET',
      headers: {
        'X-API-Key': 'your-api-key',
        'Content-Type': 'application/json',
      },
    });
    
    const data = await response.json();
    console.log(data);

    Webhook Signature Verification

    Securely verify webhook deliveries from SalesOS

    Every webhook delivery includes a signature in the X-Webhook-Signature header. Use your webhook secret to verify the signature using HMAC-SHA256.

    const crypto = require('crypto');
    
    function verifyWebhookSignature(payload, signature, secret) {
      const hmac = crypto.createHmac('sha256', secret);
      const calculatedSignature = hmac.update(JSON.stringify(payload)).digest('hex');
      
      return crypto.timingSafeEqual(
        Buffer.from(signature),
        Buffer.from(calculatedSignature)
      );
    }
    
    // Express.js example
    app.post('/webhooks', (req, res) => {
      const signature = req.headers['x-webhook-signature'];
      const secret = process.env.WEBHOOK_SECRET;
      
      if (!verifyWebhookSignature(req.body, signature, secret)) {
        return res.status(401).send('Invalid signature');
      }
      
      // Process webhook
      console.log('Webhook verified:', req.body);
      res.status(200).send('OK');
    });

    Need Help?

    Visit our Help Center for guides and troubleshooting

    Check our API Status Page for real-time system status

    Contact support at support@bdotindustries.com

    Related Resources

    Explore more SalesOS resources