A conversation list, a message thread or an unread badge needs chat data before a messaging backend exists. The chat template gives you a small messaging API behind a real URL: conversations with their last message, and the messages inside them.
What you get
The template creates a project with the base path /chat-api and 4 endpoints. Each endpoint has one ready response, so the API answers as soon as the project exists.
| Method | Path | What it answers |
|---|---|---|
GET |
/conversations |
200 with five generated conversations and their last message. |
GET |
/conversations/:id/messages |
200 with ten generated messages for the conversation in the path. |
POST |
/conversations/:id/messages |
201 with the text from the request body, a generated id and the sender me. |
POST |
/conversations/:id/read |
204 without a body. |
A conversation has id, a participant with name and avatarUrl, lastMessage, unreadCount and updatedAt. A message has id, conversationId, sender (me or participant), text, read and sentAt. Names are invented, texts are generated filler sentences, and avatarUrl points to a placeholder image that Mockhop serves itself.
Sample response
$ curl -s -X POST $URL/chat-api/conversations/3/messages \
-H "Content-Type: application/json" \
-d '{"text":"Running five minutes late."}'
{
"id": "7421",
"conversationId": "3",
"sender": "me",
"text": "Running five minutes late.",
"read": false,
"sentAt": "2026-11-15T09:12:44Z"
}
conversationId is the id from the path and text comes from your request. sender is always me and read is always false. The id and sentAt are generated on every call. Without a body, the text is See you at ten.
How to start
- Sign up at
https://app.mockhop.com/register. The quickstart explains the account and the address of your organization. - Open Projects and select Start from a template.
- Choose Example chat API and select Use template.
Then call the mock. Replace acme with your organization's address. Your mocks answer from outside once you've confirmed your email address.
$ URL=https://acme.mockhop.cloud
$ curl -s $URL/chat-api/conversations
$ curl -s $URL/chat-api/conversations/3/messages
The first call returns five conversations, the second ten messages with the conversationId 3.
What to do next
- Change the responses. Open an endpoint and edit the status code, headers and body of its response, or add more responses with matching rules.
- Add error cases and delays. For example a
404for an unknown conversation, a413for a message that is too long, or a delay to see your sending state. See Simulate API errors, timeouts and rate limits. - Use scenarios for flows. For example a message list that grows by one message on the second call. See Scenarios; scenarios are included from the Pro plan.
- Export the project. Under Import/Export you can download the project as an OpenAPI 3.0 file.
Good to know
- Nothing is delivered to anyone. The template is an example shape for your own code: a message you send reaches no person, no device and no other client.
- Responses are generated per request and the mock keeps no state. A message you send is not in the list, and marking a conversation as read does not change its
unreadCount. - The template is plain REST. There are no live updates, typing indicators or presence. For those, see WebSocket mock server; WebSocket mocks are included from the Pro plan.
- The ten messages are not in order:
sender,readandsentAtare random on every call. The lists always have five conversations and ten messages; there is no paging. - The template creates a new project, and no other project in your organization may use the base path
/chat-api. The Free plan includes one project. - You can change or delete the project and each of its endpoints at any time.
New to Mockhop? Start with the quickstart. Plans: pricing.