Skip to main content
POST
/
prompts
cURL
curl --request POST \
  --url https://www.greenflash.ai/api/v1/prompts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Customer Support Prompt",
  "description": "Standard customer support  prompt",
  "externalPromptId": "support-v1",
  "components": [
    {
      "content": "You are a helpful assistant for {{productName}}. Greet {{userName}} warmly.",
      "type": "system",
      "source": "customer",
      "name": "Base Instructions",
      "isDynamic": false
    }
  ],
  "tags": [
    "support",
    "customer-facing"
  ]
}
'
{
  "promptId": "123e4567-e89b-12d3-a456-426614174000",
  "versionId": "123e4567-e89b-12d3-a456-426614174001",
  "componentIds": [
    "123e4567-e89b-12d3-a456-426614174002"
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Prompt name.

productId
string<uuid>
required

Product this prompt will map to.

role
string
required

Role key in the product mapping (e.g. "agent tool").

Minimum string length: 1
components
object[]
required

Array of component objects.

Minimum array length: 1
externalPromptId
string

Your external identifier for the prompt.

description
string

Prompt description.

source
enum<string>
default:customer

Prompt source.

Available options:
customer,
participant,
greenflash,
agent

Response

Prompt created successfully

promptId
string<uuid>
required

The created prompt ID.

versionId
string<uuid>
required

The created version ID. Version is created but not activated (activation happens via UI or Messages API).

componentIds
string<uuid>[]
required

The IDs of the created prompt components.

externalPromptId
string

The external prompt ID.