Templates

Built-in profile templates for common businesses: plumbing, electrical, renovation, cleaning, catering, professional services, B2B software and more. Each has a few variables (service area, minimum budget…); create a profile from one with POST /v1/profiles { templateId, variables }.

The ProfileTemplate object

Properties

  • Name
    object
    Type
    'profile_template'
    Description

    The object type.

  • Name
    id
    Type
    string
    Description

    Template ID, used as templateId

  • Name
    name
    Type
    string
    Description

    Display name; also the default profile name

  • Name
    category
    Type
    'trades' | 'home_services' | 'events' | 'professional_services' | 'b2b' | 'general'
    Description

    Kind of business, for grouping in a gallery

  • Name
    description
    Type
    string
    Description

    Who the template is for and what it scores highest

  • Name
    variables
    Type
    array of TemplateVariable
    Description

    Values filled in when a profile is created; all have defaults

  • Name
    document
    Type
    object
    Description

    Profile document with {{variable}} placeholders; {{currency}} is the workspace currency


GET/v1/templates

Built-in profile templates

Create a profile from one with POST /v1/profiles \{ templateId, variables \}.

Query parameters

  • Name
    category
    Type
    'trades' | 'home_services' | 'events' | 'professional_services' | 'b2b' | 'general'
    Description

    Only templates of this category

Request

GET
/v1/templates
curl https://core.leadveyor.com/v1/templates \
  -H "Authorization: Bearer {api_key}"

Response 200

{
  "object": "list",
  "data": [
    {
      "object": "profile_template",
      "id": "plumbing",
      "name": "Plumbing",
      "category": "trades",
      "description": "Plumbers: emergencies go straight to the top, installations and renovations score higher than small repairs, jobs inside…",
      "variables": [
        {
          "key": "service_radius_km",
          "label": "Service area",
          "type": "number",
          "default": 30,
          "min": 1,
          "max": 1000,
          "unit": "km",
          "description": "How far from your business address you take jobs. Needs the workspace address; without it the distance is unknown."
        }
      ],
      "document": {
        "name": "Plumbing",
        "brief": "Plumbing business: leaks, blocked drains, hot water systems, toilets, taps, bathroom and kitchen plumbing, new installat…",
        "extract": [
          {
            "key": "job_type",
            "type": "enum",
            "values": [
              "emergency"
            ],
            "description": "emergency = happening now and causing damage or no service: burst pipe, active leak or flooding, sewage backup, no water…"
          }
        ],
        "dimensions": [
          {
            "id": "what",
            "label": "What"
          }
        ],
        "scoring": {
          "method": "sum",
          "maxGrade": 5
        },
        "criteria": [
          {
            "id": "emergency",
            "type": "escalate",
            "label": "Emergency",
            "condition": {
              "field": "fields.job_type",
              "op": "eq",
              "value": "emergency"
            },
            "reason": "Emergency job: call back now"
          }
        ],
        "tiers": [
          {
            "name": "hot",
            "minScore": 70
          }
        ],
        "junk": {
          "enabled": true,
          "extraRules": [
            "Offers of SEO, marketing, websites, lead generation or financing services are junk"
          ],
          "blockDomains": [],
          "allowDomains": []
        }
      }
    }
  ],
  "has_more": false,
  "next_cursor": null
}

GET/v1/templates/{id}

One template with its variables and document

Path parameters

  • Name
    id
    Type
    string
    Description

    Template ID, e.g. plumbing

Request

GET
/v1/templates/{id}
curl https://core.leadveyor.com/v1/templates/plumbing \
  -H "Authorization: Bearer {api_key}"

Response 200

{
  "object": "profile_template",
  "id": "plumbing",
  "name": "Plumbing",
  "category": "trades",
  "description": "Plumbers: emergencies go straight to the top, installations and renovations score higher than small repairs, jobs inside your service area and needed soon score…",
  "variables": [
    {
      "key": "service_radius_km",
      "label": "Service area",
      "type": "number",
      "default": 30,
      "min": 1,
      "max": 1000,
      "unit": "km",
      "description": "How far from your business address you take jobs. Needs the workspace address; without it the distance is unknown."
    }
  ],
  "document": {
    "name": "Plumbing",
    "brief": "Plumbing business: leaks, blocked drains, hot water systems, toilets, taps, bathroom and kitchen plumbing, new installations. We work within {{service_radius_km…",
    "extract": [
      {
        "key": "job_type",
        "type": "enum",
        "values": [
          "emergency",
          "repair"
        ],
        "description": "emergency = happening now and causing damage or no service: burst pipe, active leak or flooding, sewage backup, no water at all, gas smell. installation = new h…"
      },
      {
        "key": "property_type",
        "type": "enum",
        "values": [
          "house",
          "apartment"
        ],
        "description": "Type of property the work is for"
      }
    ],
    "dimensions": [
      {
        "id": "what",
        "label": "What"
      },
      {
        "id": "when",
        "label": "When"
      }
    ],
    "scoring": {
      "method": "sum",
      "maxGrade": 5
    },
    "criteria": [
      {
        "id": "emergency",
        "type": "escalate",
        "label": "Emergency",
        "condition": {
          "field": "fields.job_type",
          "op": "eq",
          "value": "emergency"
        },
        "reason": "Emergency job: call back now"
      },
      {
        "id": "job_value",
        "type": "rule",
        "label": "Job size",
        "dimension": "what",
        "points": 30,
        "levels": [
          {
            "grade": 5,
            "condition": {
              "field": "fields.job_type",
              "op": "in",
              "value": [
                "installation",
                "renovation"
              ]
            }
          },
          {
            "grade": 3,
            "condition": {
              "field": "fields.job_type",
              "op": "in",
              "value": [
                "repair",
                "maintenance"
              ]
            }
          }
        ]
      }
    ],
    "tiers": [
      {
        "name": "hot",
        "minScore": 70
      },
      {
        "name": "warm",
        "minScore": 40
      }
    ],
    "junk": {
      "enabled": true,
      "extraRules": [
        "Offers of SEO, marketing, websites, lead generation or financing services are junk",
        "Job applications and requests to work for us are junk"
      ],
      "blockDomains": [],
      "allowDomains": []
    }
  }
}

Was this page helpful?