{
  "info": {
    "_postman_id": "cratio-api-v1-2026",
    "name": "Cratio API v1",
    "description": "All 6 endpoints for the Cratio CRM REST API. Set the CRATIO_API_KEY environment variable to your API key (starts with le_live_).",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "version": "1.0.0"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.cratio.com",
      "type": "string"
    },
    {
      "key": "CRATIO_API_KEY",
      "value": "",
      "type": "string",
      "description": "Your Cratio API key. Starts with le_live_. Generate from Settings → Integrations → API."
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{CRATIO_API_KEY}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Leads",
      "description": "Create, retrieve, and delete leads.",
      "item": [
        {
          "name": "List Leads",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/v1/leads?limit=50&from_date=&to_date=&status=&source=&priority=&assigned_to=&offset=0",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "leads"],
              "query": [
                { "key": "limit", "value": "50", "description": "Number of results (max 500)" },
                { "key": "offset", "value": "0", "description": "Pagination offset" },
                { "key": "from_date", "value": "", "description": "YYYY-MM-DD (IST)", "disabled": true },
                { "key": "to_date", "value": "", "description": "YYYY-MM-DD (IST)", "disabled": true },
                { "key": "status", "value": "", "description": "New | Contacted | Qualified | Proposal | Won | Lost", "disabled": true },
                { "key": "source", "value": "", "description": "Lead source label", "disabled": true },
                { "key": "priority", "value": "", "description": "Low | Medium | High", "disabled": true },
                { "key": "assigned_to", "value": "", "description": "Assigned user email", "disabled": true }
              ]
            },
            "description": "Retrieve leads with optional filters. Default returns last 30 days, limit 50."
          },
          "response": []
        },
        {
          "name": "Create Lead",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Rahul Sharma\",\n  \"phone\": \"+91 98765 43210\",\n  \"email\": \"rahul@techcorp.in\",\n  \"company\": \"TechCorp Solutions\",\n  \"city\": \"Mumbai\",\n  \"source\": \"IVR\",\n  \"status\": \"New\",\n  \"priority\": \"High\",\n  \"deal_value\": 150000,\n  \"tags\": [\"hot-lead\", \"inbound\"],\n  \"notes\": \"Interested in Pro plan\",\n  \"assigned_to\": \"sales@company.com\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/leads",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "leads"]
            },
            "description": "Create a new lead. If a lead with the same phone or email exists, it is merged and updated (returns 200 instead of 201). Minimum: name + phone or email."
          },
          "response": []
        },
        {
          "name": "Delete Lead",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/v1/leads/:id",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "leads", ":id"],
              "variable": [
                {
                  "key": "id",
                  "value": "550e8400-e29b-41d4-a716-446655440000",
                  "description": "Lead UUID"
                }
              ]
            },
            "description": "Permanently delete a lead and all associated activities, call logs, and notes. Irreversible."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Call Logs",
      "description": "Log and retrieve call records.",
      "item": [
        {
          "name": "List Call Logs",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/v1/call-logs?limit=50&offset=0",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "call-logs"],
              "query": [
                { "key": "limit", "value": "50", "description": "Number of results (max 500)" },
                { "key": "offset", "value": "0", "description": "Pagination offset" },
                { "key": "from_date", "value": "", "description": "YYYY-MM-DD (IST)", "disabled": true },
                { "key": "to_date", "value": "", "description": "YYYY-MM-DD (IST)", "disabled": true },
                { "key": "lead_id", "value": "", "description": "Filter by lead UUID", "disabled": true },
                { "key": "call_type", "value": "", "description": "Inbound | Outbound", "disabled": true }
              ]
            },
            "description": "Retrieve call logs. Default returns last 30 days, limit 50."
          },
          "response": []
        },
        {
          "name": "Create Call Log",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"lead_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"call_type\": \"Outbound\",\n  \"duration_seconds\": 185,\n  \"outcome\": \"Completed\",\n  \"notes\": \"Discussed pricing. Will send proposal.\",\n  \"called_at\": \"2026-04-22T10:30:00Z\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{base_url}}/api/v1/call-logs",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "call-logs"]
            },
            "description": "Log a call against a lead. Use duration_seconds: 0 for missed calls."
          },
          "response": []
        },
        {
          "name": "Delete Call Log",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/v1/call-logs/:id",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "call-logs", ":id"],
              "variable": [
                {
                  "key": "id",
                  "value": "660e8400-e29b-41d4-a716-446655440001",
                  "description": "Call log UUID"
                }
              ]
            },
            "description": "Permanently delete a call log by UUID."
          },
          "response": []
        }
      ]
    }
  ]
}
