- a unique
key(used by clients), - the
public_valueshown in UI menus, - the
masked_valueinjected after the system prompt, - optional
descriptionandtags.
Authentication
Administrative endpoints live under/api/v1/preprompts and are protected by the
backendSecretMiddleware. Send either:
BACKEND_SECRET is configured in your environment variables. Requests without
this token receive 401 BACKEND_SECRET_REQUIRED.
Quick start
- Create the masked prompt via the admin API (requires
BACKEND_SECRET). - Surface the public catalog (
GET /api/v1/public/preprompts) to end-users. - Send the chosen
preprompt_keyalong with every/api/v1/ai/chatcall.
preprompts collection—see the
PrePrompts guide for schema details.
Endpoints & cURL snippets
Create (admin)
POST /api/v1/preprompts
409 CONFLICT.
List (admin)
GET /api/v1/preprompts?include_deleted=false
include_deleted=true flag reveals soft-deleted rows to help with audits.
Update (admin)
PUT /api/v1/preprompts/{id}
key, public_value, masked_value, description, tags).
Key changes remain unique across deleted items as well.
Soft-delete (admin)
DELETE /api/v1/preprompts/{id}
is_deleted=true, allowing instant restoration via PUT or re-POST.
Public catalog (no auth)
GET /api/v1/public/preprompts
preprompt_key
to /api/v1/ai/chat. Only the backend ever accesses masked_value, keeping internal
instructions hidden from clients.