POST
/
rest
/
publish-prompt-template
curl --request POST \
  --url https://api.promptlayer.com/rest/publish-prompt-template \
  --header 'Content-Type: application/json' \
  --data '{
  "api_key": "<string>",
  "metadata": {
    "model": {
      "provider": "<string>",
      "name": "<string>",
      "parameters": {}
    },
    "customField": "<string>"
  },
  "prompt_name": "<string>",
  "prompt_template": {
    "input_variables": [
      "<string>"
    ],
    "messages": [
      {
        "prompt": {
          "input_variables": [
            "<string>"
          ],
          "template": "<string>",
          "template_format": "<string>",
          "validate_template": true
        },
        "additional_kwargs": {},
        "role": "<string>"
      }
    ],
    "functions": [
      {
        "name": "<string>",
        "description": "<string>",
        "parameters": {}
      }
    ],
    "function_call": "none"
  },
  "tags": [
    "<string>"
  ],
  "commit_message": "<string>"
}'
{
  "id": 123,
  "success": true
}

Publish Prompt Template allows you to programmatically create a new version of a prompt. This endpoint works with the deprecated prompt template format. This was meant to be used alongside promptlayer.prompts.get. However, we recommend using the new prompt format and the promptlayer.templates.publish endpoint instead.

Body

application/json
api_key
string
required

Your PromptLayer API Key

metadata
object
prompt_name
string
required

Prompt name has to be less than 128 characters and can only contain letters, numbers, and underscores. If a prompt exists with this name it will be pushed into an older version

prompt_template
object
required

Chat Prompt Template

tags
string[]

Array of string tags for a template

commit_message
string

Commit message for the prompt version

Response

200 - application/json
id
integer
required
success
boolean
required