Skip to main content
POST
/
api
/
v1
/
preprompts
Create a pre-prompt
curl --request POST \
  --url https://handauncle-backend-prod-205012263523.asia-south1.run.app/api/v1/preprompts \
  --header 'Content-Type: application/json' \
  --data '
{
  "key": "<string>",
  "publicValue": "<string>",
  "maskedValue": "<string>",
  "description": "<string>",
  "tags": [
    "<string>"
  ]
}
'
{
  "success": true,
  "data": {
    "id": "<string>",
    "key": "<string>",
    "publicValue": "<string>",
    "maskedValue": "<string>",
    "isDeleted": true,
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "description": "<string>",
    "tags": [
      "<string>"
    ]
  },
  "meta": {
    "timestamp": "2023-11-07T05:31:56Z",
    "requestId": "<string>"
  }
}
Create a masked pre-prompt by pairing a public label with the hidden maskedValue that is injected after the system prompt. Send Authorization: Bearer <BACKEND_SECRET> or X-Backend-Secret: <BACKEND_SECRET> with every admin request.

Request Body

FieldTypeRequiredDescription
keystringUnique identifier (2-64 chars, alphanumeric with underscores/dashes)
publicValuestringUser-facing label (1-512 chars)
maskedValuestringHidden prompt injected into LLM context (1-4000 chars)
descriptionstringOptional description (max 500 chars)
tagsstring[]Optional tags for categorization (max 16 tags)

Headers

X-Backend-Secret
string

Backend secret token required for admin-only endpoints. Provide either this header or Authorization: Bearer <secret>.

Body

application/json
key
string
required
Required string length: 2 - 64
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_-]{1,63}$
publicValue
string
required
Required string length: 1 - 512
maskedValue
string
required
Required string length: 1 - 4000
description
string | null
Maximum string length: 500
tags
string[] | null
Maximum array length: 16
Maximum string length: 50

Response

PrePrompt created.

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required