> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# Submit a form

**Published**: 2026-11-30
**Category**: Forms & Reviews

## `POST /forms/:slug/submissions`

**Submit a form**

Submits to the form translation that `GET /forms/{slug}` serves for
the same `locale` and `fallback`.

Send values in `data`, keyed by field id. A `checkbox` or `select`
field also takes an array, and a `tel` field a
`{ countryCode, number }` object. With honeypot on, also send an
empty `_hp` and `_ts`, the display time in Unix milliseconds. With
reCAPTCHA, send `recaptchaToken`.

A failed field returns 422 with `field`, a `VALIDATION_FIELD_*` code
and `params`. A closed form returns 400 `RESOURCE_LOCKED`, a failed
verification 400 `SPAM_RECAPTCHA_FAILED`, a `requireAuth` form without
a customer `Authorization: Bearer` token 401 `CUSTOMER_AUTH_REQUIRED`,
and an unknown slug 404.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale |


### Request Body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | object | Yes | Required. Resource data object |
| `locale` | string | No | Form translation to submit, such as `en` or `pt-BR`. Served through the locale chain unless `fallback=false`. |
| `honeypot` | string | No | Spam-trap field that must remain empty; a filled value causes silent rejection |
| `recaptchaToken` | string | No | Token for the site or form verification. v3 needs action `form_submit`. Each token works once. |
| `session_id` | string | No | Analytics session UUID. UUID format |
| `visitor_id` | string | No | 8-64 characters |
| `_hp` | string | No | Spam-trap field that must remain empty when the site uses honeypot protection. |
| `_ts` | integer | No | Form-load Unix timestamp in milliseconds when the site uses honeypot protection. |


### Responses

| Status | Description |
| --- | --- |
| `201` | Successful response |
| `400` | Spam protection failed: the `_ts` timestamp is too old, or the verification token is missing or invalid. |
| `401` | The resource requires a customer session token and none valid was sent |
| `402` | The site subscription does not currently permit this operation |
| `404` | Not found |
| `422` | Validation error |
| `429` | Rate limit exceeded, or the `_ts` timestamp is missing, malformed or too recent. |


> **Notes:** Limit: 10 per 15 minutes per site and client. A bad `_ts` returns 429
> `RATE_SUBMISSION_TOO_FAST`, or 400 `RATE_SUBMISSION_EXPIRED` if expired.

### SDK

```typescript
import { createClient } from 'lynkow'

const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! })

const form = await lynkow.forms.getBySlug('contact')

// Build the payload with field.id as key. The SDK does not transform
// semantic names into ids; you must do that yourself based on the schema.
const data: Record<string, string> = {}
for (const field of form.schema.fields) {
  data[field.id] = readValueForField(field) // your UI binding
}

const result = await lynkow.forms.submit('contact', data)

// Never hand `redirectUrl` to `window.location` as it comes: parse it, and
// follow it only when it resolves to http or https.
function redirectTarget(redirectUrl?: string): string | null {
  if (!redirectUrl) return null
  try {
    const url = new URL(redirectUrl, window.location.href)
    return url.protocol === 'http:' || url.protocol === 'https:' ? url.href : null
  } catch {
    return null
  }
}

const target = redirectTarget(result.redirectUrl)
if (target) {
  // The form is configured to send the visitor to a thank-you page
  window.location.assign(target)
} else {
  // Show the success message
  console.log(result.message)
}
```

### Examples

```curl
# Replace the example _ts with the time in milliseconds when the form was displayed.
curl -X POST "https://api.lynkow.com/storefront/{siteId}/forms/contact/submissions" \
  -H "Content-Type: application/json" \
  -d '{ "data": { "email": "anna.cooper@example.com", "message": "Hi" }, "locale": "en", "_hp": "", "_ts": 1788955200000 }'
```

```javascript
// formStartedAt is Date.now() captured when the form was displayed.
await fetch(`https://api.lynkow.com/storefront/${siteId}/forms/contact/submissions`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    data: { email: 'anna.cooper@example.com', message: 'Hi' },
    locale: 'en',
    _hp: '',
    _ts: formStartedAt,
  }),
})
```

### Response Example

```json
{
  "data": {
    "success": true,
    "message": "Thanks, we got your message and will reply within 24 hours.",
    "redirectUrl": "https://acme.io/thank-you"
  }
}
```

---