Skip to main content
POST
/
api
/
v1
/
prompts
Create a new prompt
curl --request POST \
  --url https://app.dimred.com/api/v1/prompts \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "project_id": "proj_abc123",
  "prompt_text": "Classify the sentiment as positive or negative",
  "prompt_message_type": "system",
  "output_schema": {
    "type": "object",
    "properties": {
      "sentiment": {
        "type": "string",
        "enum": [
          "positive",
          "negative"
        ]
      },
      "confidence": {
        "type": "number"
      }
    },
    "required": [
      "sentiment"
    ]
  }
}'
{
  "id": "<string>",
  "prompt_message_id": "<string>",
  "project_id": "<string>",
  "prompt_message_type": "system",
  "prompt_text": "<string>",
  "input_schema": {},
  "output_schema": {},
  "prompt_source": "<string>",
  "prompt_source_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

x-api-key
string
header
required

API key for authentication. Obtain from your DimRed dashboard. The organization context is automatically derived from the API key.

Body

application/json
project_id
string
required

Project identifier

prompt_text
string
required

Content of the prompt message

output_schema
object
required

JSON schema for structured output (required)

prompt_message_type
enum<string>
default:system

Type of the message

Available options:
system,
user,
assistant
input_schema
object | null

JSON schema for input validation

Response

Prompt created successfully

id
string

Unique identifier for the prompt

prompt_message_id
string

Message identifier

project_id
string

Project identifier

prompt_message_type
enum<string>

Type of the message

Available options:
system,
user,
assistant
prompt_text
string

Content of the prompt

input_schema
object | null

JSON schema for input validation

output_schema
object | null

JSON schema for structured output

prompt_source
string | null

Source of the prompt

prompt_source_id
string | null

Source identifier

created_at
string<date-time>

ISO 8601 timestamp of creation