For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Trust CenterStatusSupportGet a demoPlatform
DocumentationEvals API ReferenceIntegrations & OTELPlatform SettingsSelf-HostingGuidesChangelog
DocumentationEvals API ReferenceIntegrations & OTELPlatform SettingsSelf-HostingGuidesChangelog
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
    • Data Models
    • API Conventions
  • Data Models
      • GETList Prompts
      • POSTPush Prompts
  • Evals
  • Legacy
LogoLogo
Trust CenterStatusSupportGet a demoPlatform
Data ModelsPrompts

Push Prompts

POST
https://api.confident-ai.com/v1/prompts
POST
/v1/prompts
$curl -X POST https://api.confident-ai.com/v1/prompts \
> -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
> -H "Content-Type: application/json" \
> -d '{
> "alias": "Prompt Name",
> "text": "Hello, {{name}}!",
> "interpolationType": "FSTRING",
> "outputType": "TEXT"
>}'
200Text-Prompt
1{
2 "success": true,
3 "data": {
4 "promptId": "prm_xyz456",
5 "hash": "bab04ce"
6 },
7 "link": "https://app.confident-ai.com/project/<PROJECT_ID>/prompt-studio/editor/prm_xyz456",
8 "deprecated": false
9}

Creates a new commit for an existing prompt, or creates a new prompt with the given alias otherwise.

Was this page helpful?
Previous

Pull Prompts By Label

Next
Built with

Headers

CONFIDENT_API_KEYstringRequired
The API key of your Confident AI project.

Request

aliasstringRequired
The unique alias of the prompt.
textstringOptional

The text content of the prompt. Supply this only if you are creating a text-based prompt.

messageslist of objectsOptional

The list of messages that make up the prompt. Supply this only if you are creating a list-based prompt.

interpolationTypeenumOptionalDefaults to FSTRING
The type of interpolation format used in the prompt to insert dynamic variables.
Allowed values:
modelSettingsobjectOptional
This is the model settings for the prompt.
outputTypeenumOptionalDefaults to TEXT
The type of output expected from the prompt.
Allowed values:
outputSchemaobjectOptional
This is the output schema definition when outputType is SCHEMA.
toolslist of objectsOptional
branchstringOptional
The name of the branch you want to push the new commit to. Defaults to "main" if not specified.

Response

successboolean
This is true if the prompt was successfully created.
dataobject
This maps to the prompt version id.
linkstring
This is the URL to redirect to after the prompt is created.
deprecatedboolean
This is true if this endpoint is deprecated.