> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wiseyield.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Join waiting list

> Public endpoint to register interest in WiseYield early access.

The waiting list endpoint accepts unauthenticated submissions and persists them with a confirmation email sent asynchronously.

```
POST https://www.wiseyield.co/api/waiting-list
```

<Note>
  **Public endpoint.** No authentication required. Submissions are deduplicated by email.
</Note>

## Request body

Only two fields are required. Everything else is optional and intended to surface higher-priority leads during onboarding.

### Required

<ParamField body="email" type="string" required>
  Valid email address. Duplicates return `409 Conflict`.
</ParamField>

<ParamField body="fullName" type="string" required>
  2–100 characters.
</ParamField>

### Optional

<ParamField body="farmName" type="string">
  Up to 100 characters.
</ParamField>

<ParamField body="city" type="string">
  Up to 100 characters.
</ParamField>

<ParamField body="country" type="string">
  Up to 100 characters.
</ParamField>

<ParamField body="farmSize" type="string">
  Numeric string (e.g. `"250"`). Empty string is treated as omitted.
</ParamField>

<ParamField body="sizeUnit" type="string">
  One of `hectares`, `acres`, `feddans`.
</ParamField>

<ParamField body="cropsInterest" type="string">
  Free text, up to 500 characters. Stored as a single-element array on the record.
</ParamField>

<ParamField body="phone" type="string">
  Up to 20 characters.
</ParamField>

<ParamField body="currentTools" type="string">
  Up to 500 characters. **Validated but not persisted** — used only at form-submission time.
</ParamField>

<ParamField body="additionalNotes" type="string">
  Up to 500 characters. **Validated but not persisted.**
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  `true` on success, `false` on error.
</ResponseField>

<ResponseField name="message" type="string">
  Success copy (only on success).
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="Data">
    <ResponseField name="id" type="string">The waiting-list entry ID.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="error" type="string">
  Human-readable error category (only on error).
</ResponseField>

<ResponseField name="details" type="object">
  Per-field validation errors when `error` is `"Invalid form data"`. Object keys are field names; values are arrays of messages.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://www.wiseyield.co/api/waiting-list \
    -H "Content-Type: application/json" \
    -d '{
      "email": "john@example.com",
      "fullName": "John Smith",
      "farmName": "Green Valley Farm",
      "city": "Des Moines",
      "country": "United States",
      "farmSize": "250",
      "sizeUnit": "acres",
      "cropsInterest": "Corn, Soybeans"
    }'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch('https://www.wiseyield.co/api/waiting-list', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      email: 'john@example.com',
      fullName: 'John Smith',
      farmName: 'Green Valley Farm',
      city: 'Des Moines',
      country: 'United States',
      farmSize: '250',
      sizeUnit: 'acres',
      cropsInterest: 'Corn, Soybeans',
    }),
  });

  const result = await res.json();
  console.log(result.message);
  ```

  ```python Python theme={null}
  import requests

  res = requests.post(
      'https://www.wiseyield.co/api/waiting-list',
      json={
          'email': 'john@example.com',
          'fullName': 'John Smith',
          'farmName': 'Green Valley Farm',
          'city': 'Des Moines',
          'country': 'United States',
          'farmSize': '250',
          'sizeUnit': 'acres',
          'cropsInterest': 'Corn, Soybeans',
      },
  )
  print(res.json()['message'])
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "success": true,
    "message": "Successfully joined the waiting list!",
    "data": {
      "id": "wl_..."
    }
  }
  ```

  ```json 400 Bad Request — Invalid email theme={null}
  {
    "success": false,
    "error": "Invalid form data",
    "details": {
      "email": ["Please enter a valid email address"]
    }
  }
  ```

  ```json 400 Bad Request — Required field missing theme={null}
  {
    "success": false,
    "error": "Required field missing. Please fill all required fields."
  }
  ```

  ```json 400 Bad Request — Invalid data format theme={null}
  {
    "success": false,
    "error": "Invalid data format. Please check your input."
  }
  ```

  ```json 409 Conflict theme={null}
  {
    "success": false,
    "error": "This email is already on our waiting list."
  }
  ```

  ```json 500 Internal Server Error theme={null}
  {
    "success": false,
    "error": "An error occurred. Please try again."
  }
  ```
</ResponseExample>

## Errors

| Status | When                                                                                                       |
| ------ | ---------------------------------------------------------------------------------------------------------- |
| `400`  | Validation failed, required field missing, or data format invalid. `details` may carry per-field messages. |
| `409`  | Email already on the waiting list.                                                                         |
| `500`  | Unhandled server error.                                                                                    |

## Side effects

* A confirmation email is sent asynchronously (Resend). Email delivery is **non-blocking** — the API returns success even if the email send fails.
* The submission is persisted with `status: "pending"` and surfaces in the admin approval queue.

## Notes

* Sending the same email twice returns `409 Conflict`. Users who need to update their entry should contact [support@wiseyield.co](mailto:support@wiseyield.co).
* `currentTools` and `additionalNotes` are accepted by the schema for backwards compatibility but are not currently persisted to the record. Use `cropsInterest` for any free-text context you want preserved.
* `cropsInterest` is normalised to a single-element array in storage. Send a comma-separated string and the API takes it as-is.
