> For the complete documentation index, see [llms.txt](https://docs.tiny.plus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tiny.plus/api/endpoints/enquiries.md).

# Enquiries

Enquiries live at `/v2/enquiries`. They support every request on the [Records](/api/endpoints/records.md) page: list, get, history, create, update, delete and search.

To capture enquiries from your website, you don't need the API: see [Capturing website enquiries](/api/getting-access/javascript-token.md).

## Creating an enquiry

```bash
curl -X POST "https://api.tiny.plus/v2/enquiries" \
  -H "Authorization: Bearer {{user_access_token}}" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "New aged care facility",
        "description": "Asked about a 120-bed facility in Auchenflower.",
        "contact_name": "Andrew Xavier",
        "contact_company": "Xavier Developers",
        "contact_email": "andrew@example.com",
        "contact_phone": "0400 000 000",
        "assigned_user": "1231"
      }'
```

```javascript
{
    "id": "161082"
}
```

* A new enquiry's `record_status` is `open`, or the first phase of `open` on accounts that use phases.
* If you don't send a `followup_date`, it's set to two business days after the enquiry is created, counting Monday to Friday. Public holidays aren't skipped.

## The person and company

`contact_name` and `contact_company` hold either text or a record id:

* **Text**, such as `"Andrew Xavier"`, is stored as it is. No contact or company is looked up or created.
* **The id of an existing contact or company** links the enquiry to that record.

Reads return what's stored: the text, or the id.

Turning an enquiry into a project or contact is done in tiny+.

## Fields

| Field             | Label in tiny+  | Type              | Notes                                                                                                           | Editable |
| ----------------- | --------------- | ----------------- | --------------------------------------------------------------------------------------------------------------- | -------- |
| `assigned_user`   | Assigned To     | Team member id    | A team member's id.                                                                                             | Yes      |
| `contact_company` | Contact Company | Text or record id | Their company: text, or an existing company's id. See [The person and company](#the-person-and-company).        | Yes      |
| `contact_email`   | Contact Email   | Email address     |                                                                                                                 | Yes      |
| `contact_name`    | Contact Name    | Text or record id | The person who asked: text, or an existing contact's id. See [The person and company](#the-person-and-company). | Yes      |
| `contact_phone`   | Contact Phone   | Text              |                                                                                                                 | Yes      |
| `contact_role`    | Contact Role    | Text              |                                                                                                                 | Yes      |
| `description`     | Details         | Text              |                                                                                                                 | Yes      |
| `followup_date`   | Follow-up by    | Date              | `YYYY-MM-DD`. Two business days after the enquiry is created, unless you send another.                          | Yes      |
| `location_id`     | Location        | Address           | An address. Reads return its id only.                                                                           | Yes      |
| `name`            | Subject         | Text              | Required. What the enquiry is about. Up to 200 characters.                                                      | Yes      |
| `notes`           | Notes           | Text              |                                                                                                                 | Yes      |
| `record_status`   | Current Status  | Option            | `open` unless you send another, or the first phase of `open` on accounts that use phases.                       | Yes      |
