Saved Replies
A saved reply is a shortcut your team sends from the inbox composer: a title, a shortcut a teammate types after /, the text to send and, if you like, a file. In the dashboard they're the composer's saved messages. With the Public API your system or an AI assistant keeps them up to date, such as this month's prices. Everything lives under /v1/agents/{agentId}/saved-replies.
What is a saved reply, and who sends it?
A saved reply belongs to one agent and is shared by everyone who works on it. It has a title, a shortcut unique in the agent, content (the text sent), a sort_order, an active switch and optional media: one image, video or document, or up to 10 images for an album. Nothing reaches a customer until a teammate picks it in the composer and sends it.
Changing a saved reply changes what your team sends from then on, never what was already sent. Replies already sent with one stay in their conversations, even after it's deleted.
How do I list an agent's saved replies?
GET them. They come in their order, and only the switched-on ones unless you send include_inactive=true:
curl "https://api.mojeeb.app/v1/agents/YOUR_AGENT_ID/saved-replies?include_inactive=true" \
-H "Authorization: Bearer mk_live_YOUR_KEY_HERE"
Each one describes its media (its kind, how many files, their total size and the first file's name) and never links to the files. The list comes whole, not in pages. See the List saved replies reference.
How do I create a saved reply?
POST its title, shortcut and text. Keep the id it returns to put media on it or change it later.
curl -X POST https://api.mojeeb.app/v1/agents/YOUR_AGENT_ID/saved-replies \
-H "Authorization: Bearer mk_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{ "title": "Prices", "shortcut": "prices", "content": "Here are our prices for this month 👇" }'
The shortcut must be unique in the agent: one another saved reply already uses is 422 invalid_request. title can't contain angle brackets. Every field and its length is in the Create a saved reply reference. A new saved reply has text only; media comes next.
How do I put images, a video or a document on a saved reply?
POST the links to its media/import: one image, video or document, or up to 10 images for an album, in order. Each is an https link Mojeeb downloads or the url of a Mojeeb upload of this agent, for a file that isn't online. It replaces the saved reply's media, and keeps its text.
curl -X POST https://api.mojeeb.app/v1/agents/YOUR_AGENT_ID/saved-replies/SAVED_REPLY_ID/media/import \
-H "Authorization: Bearer mk_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{ "media_urls": ["https://api.mojeeb.app/v1/agents/YOUR_AGENT_ID/uploads/UPLOAD_ID"] }'
A link must answer 200 with the file itself within 20 seconds, from a public address; redirects aren't followed. Every link is read before anything stored changes, and one that can't be read is 422 media_url_invalid, with param naming it. The kinds and sizes each file may be are in the Put media on a saved reply reference.
How do I change a saved reply or switch it off?
PUT it whole: its title, shortcut, text and order, with "active": false to switch it off. A switched-off saved reply is hidden from the composer and kept; send "active": true to bring it back. Its media stays as it is.
Send content with every replace, even when only the title changes: a replace sets the text from the body, and only a saved reply with media may have empty text (422 invalid_request otherwise). See the Replace a saved reply reference.
How do I remove a saved reply's media or delete it?
DELETE its media to remove its files and keep its text. That is refused with 422 invalid_request when the saved reply has no text, as it would be left empty. DELETE the saved reply itself to remove it and its files for good; there's no undo. Replies already sent with it stay in their conversations. See the Remove a saved reply's media reference and the Delete a saved reply reference.
Which errors should I expect?
Besides the errors every endpoint can return, these are the ones saved replies add. Each leaves the saved reply as it was. The full list is on Errors.
| Error | What to do |
|---|---|
422 invalid_request | The shortcut is taken by another of the agent's saved replies, the saved reply would be left with neither text nor media, or the media isn't one image, video or document or up to 10 images. The message says which. |
422 media_url_invalid | A link in media_urls can't be read (param names it). Use a direct https link that answers 200 with the file, or an upload's url. |
422 invalid_request_body | A field is missing or breaks its limits (param names it). |
404 not_found | No saved reply of this agent has that id. |
Common questions
Are these the same as the dashboard's saved messages?
Yes. A saved reply added through the API shows in the composer's Saved messages, and one added there can be read and changed through the API. A saved message made in the dashboard can carry an audio file, which the API describes as audio; the API puts only images, a video or a document on one.
Can an AI assistant manage saved replies?
Yes, through the MCP server: it lists, creates and replaces saved replies and puts media on them, from links or from a file you give it, through an upload. Deleting a saved reply or removing its media isn't one of its tools: do that in the dashboard or with the API.
How many media imports can I send?
Putting media on a saved reply shares 10 requests a minute per key with the other endpoints that have a lower limit, such as the WhatsApp template endpoints and AI attachment media imports, because each one stores files. The other saved reply calls count against the default 60 a minute. See Rate Limits.
What if a create's response never arrives?
List the saved replies before you create again. Creating one takes no idempotency key, and a retry with the same shortcut is refused with 422 invalid_request when the first create went through. Find it by its shortcut and carry on with it.
Which scopes do these calls need?
saved_replies:read to list saved replies, and saved_replies:write to create, replace, switch off and delete them and change their media. Every key holds both today; see Authentication.