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": "f-string",
          "validate_template": true
        },
        "additional_kwargs": {},
        "role": "<string>"
      }
    ],
    "functions": [
      {
        "name": "<string>",
        "description": "",
        "parameters": {
          "type": "object",
          "properties": {}
        }
      }
    ],
    "function_call": "none"
  },
  "tags": [],
  "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

Response

200
application/json

Successful Response

The response is of type object.