---
title: "Create a lead"
method: POST
path: "/enquiries"
tags: ["Enquiries"]
---

# Create a lead

`POST /enquiries`

## Request

- Base URL: `https://api3.autarc.energy/v1`
- URL: `https://api3.autarc.energy/v1/enquiries`
- Auth: API key in header `X-Api-Key`

Creates a new enquiry (lead) for the authenticated company.
If `assignedUserId` is omitted and `postcode` is present, Autarc applies the company's postcode (PLZ) lead assignment rules and assigns the lead to the matching team member when one is found.
`projectId` can link the lead to an existing project in the authenticated company. When `projectId` is set without `customerId`, the lead uses the project's customer. When both are set, the project must belong to the supplied customer; otherwise the request fails with 400.

## Request body

- CreateEnquiryRequest: Company is inferred from the API key or access token. `name` is required. If `assignedUserId` is omitted and `postcode` is present, Autarc applies the company's postcode (PLZ) lead assignment rules and assigns the lead when a matching team member is found. An explicit `assignedUserId` always overrides postcode assignment. `projectId` links the lead to an existing project. If `customerId` is omitted, the project's customer is used. If both `projectId` and `customerId` are set, they must refer to the same customer or the request fails with 400.
  - `name` string, required: Lead name, for example the contact or household name.
  - `phone` string: Optional phone number for the lead.
  - `email` string, email: Optional email address for the lead.
  - `postcode` string: Optional postcode for the lead address. Used for PLZ auto-assignment when `assignedUserId` is omitted.
  - `addressLine1` string: Optional first address line for the lead.
  - `city` string: Optional city. Used when a new customer is created because `customerId` is omitted.
  - `country` string: Optional country. Used when a new customer is created because `customerId` is omitted.
  - `countryCode` string: Optional ISO country code. Used when a new customer is created because `customerId` is omitted.
  - `notes` string: Optional free-text notes for the lead.
  - `customerId` string, uuid: Optional existing customer DB UUID to link this lead to.
  - `projectId` string, uuid: Optional existing project DB UUID to link this lead to. If set without `customerId`, the project's customer is used.
  - `assignedUserId` string, uuid: Optional team member profile DB UUID to assign this lead to. Overrides postcode assignment when provided.
  - `source` 'api' | 'zapier': Optional public source for the lead. Defaults to `api` when omitted.

## Response `201`

Created

- Enquiry: Enquiry (lead) summary returned by the public create endpoint.
  - `id` string, uuid, required
  - `name` string, required
  - `status` string, required: Current lead pipeline status.
  - `source` string, required: Source that created the lead.
  - `phone` string, nullable
  - `email` string, email, nullable
  - `postcode` string, nullable
  - `addressLine1` string, nullable
  - `notes` string, nullable
  - `estimate` number, nullable
  - `customerId` string, uuid, nullable
  - `projectId` string, uuid, nullable
  - `stageId` string, uuid, nullable
  - `assignedUserId` string, uuid, nullable
  - `rejectedReason` string, nullable
  - `reminderDate` string, date-time, nullable
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400`: Bad request - missing name, invalid source, project/customer mismatch, or project without customer.
- `404`: The specified resource was not found

---

[API](https://skmtc.dev/autarc/apis/autarc-2-0-api.md) - [All operations](https://skmtc.dev/autarc/apis/autarc-2-0-api/llms.txt) - [OpenAPI document](https://skmtc.dev/autarc/apis/autarc-2-0-api/revisions/adfb20a40efc?raw)
