Search Documentation

Search for a documentation page...

Contact Messages API

REST API endpoint for store contact form submissions.

Contact messages are submissions from your store's contact form. Creating one saves the message against the store and triggers an email notification to the merchant. This is intended for storefronts and external integrations that collect messages from visitors.

Create Contact Message

POST /api/v1/contact-messages

Saves a contact form message and notifies the merchant by email. The email notification is sent in the background, so the response returns as soon as the message is stored.

Request Body

FieldTypeRequiredDescription
emailstringYesSender email address
messagestringYesMessage content (1-5000 characters)
curl -X POST \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"email": "jane@example.com", "message": "Do you ship internationally?"}' \
https://your-store.yns.store/api/v1/contact-messages

Response (201)

{
"id": "0191abc0-1234-7def-8000-000000000001",
"storeId": "0191abc0-0000-7000-8000-000000000abc",
"email": "jane@example.com",
"message": "Do you ship internationally?",
"readAt": null,
"createdAt": "2024-06-15T10:30:00.000Z",
"updatedAt": "2024-06-15T10:30:00.000Z"
}

A 400 is returned with { error, details } when the email is malformed or the message is empty or over 5000 characters.