Skip to Content
Launching the open-source gateway

Deploy a prompt version

POSThttps://api.respan.ai/api/prompts/{prompt_id}/deployments/

Deploy a committed version as the live version for this prompt.

Servers

https://api.respan.ai — Respan API Server

Authentication

RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: bearer; format: Respan API key.

HTTP
Authorization: Bearer $RESPAN_API_KEY

Or:

DashboardJwt

Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

HTTP scheme: bearer; format: Dashboard JWT.

HTTP
Authorization: Bearer $RESPAN_DASHBOARD_JWT

Path parameters

Parameter Type Required Description and constraints
prompt_id string Required
The unique prompt identifier.

Request body

A request body is required.

application/json

Field Type Requirement Description and constraints
$ object Required body
—
version integer Required in parent
Version number to deploy as live.
Example: 3

OpenAPI request schema

{
  "type": "object",
  "properties": {
    "version": {
      "type": "integer",
      "description": "Version number to deploy as live.",
      "example": 3
    }
  },
  "required": [
    "version"
  ]
}

Responses

201

Version deployed successfully.

application/json

Field Type Requirement Description and constraints
$ object Body
Example: {"id":"pv_abc123","prompt_version_id":"pv_abc123","version":3,"description":"Improved system prompt for better context handling","messages":[{"role":"system","content":"You are a helpful assistant. Context: {{context}}"}],"model":"gpt-4o","readonly":true,"is_deployed":true,"edited_by":{"id":123,"email":"user@example.com","first_name":"John","last_name":"Doe"},"created_at":"2026-02-27T10:00:00Z","updated_at":"2026-02-27T10:00:00Z"}
id string Optional
—
prompt_version_id string Optional
—
version integer Optional
—
description string or null Optional
—
messages array<object> Optional
—
messages[] object Array item
Additional properties are allowed
model string Optional
—
readonly boolean Optional
—
edited_by object Optional
—
edited_by.id integer Optional
—
edited_by.email string Optional
—
edited_by.first_name string Optional
—
edited_by.last_name string Optional
—
created_at string Optional
Format: date-time
updated_at string Optional
Format: date-time

OpenAPI response schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "prompt_version_id": {
      "type": "string"
    },
    "version": {
      "type": "integer"
    },
    "description": {
      "type": "string",
      "nullable": true
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "model": {
      "type": "string"
    },
    "readonly": {
      "type": "boolean"
    },
    "edited_by": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "email": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "example": {
    "id": "pv_abc123",
    "prompt_version_id": "pv_abc123",
    "version": 3,
    "description": "Improved system prompt for better context handling",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant. Context: {{context}}"
      }
    ],
    "model": "gpt-4o",
    "readonly": true,
    "is_deployed": true,
    "edited_by": {
      "id": 123,
      "email": "user@example.com",
      "first_name": "John",
      "last_name": "Doe"
    },
    "created_at": "2026-02-27T10:00:00Z",
    "updated_at": "2026-02-27T10:00:00Z"
  }
}

400

Validation failed, or the version is a draft. Commit it first.

application/json

Field Type Requirement Description and constraints
$ object Body
Maps each invalid field to its error messages, or has a detail message.
$.<key> any Map value
—

OpenAPI response schema

{
  "type": "object",
  "description": "Maps each invalid field to its error messages, or has a `detail` message.",
  "additionalProperties": {}
}
The version is a draft
JSON
{ "detail": "Cannot deploy a draft version. Commit it first." }
No version given
JSON
{ "version": [ "This field is required." ] }

403

The API key is missing, invalid or expired.

application/json

Field Type Requirement Description and constraints
$ object Body
—
detail string Required in parent
—

OpenAPI response schema

{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
Example
JSON
{ "detail": "Your API key is invalid or expired, please check your API key in the platform settings." }

404

The prompt or version doesn’t exist, or the prompt has no committed version.

application/json

Field Type Requirement Description and constraints
$ object Body
—
detail string Required in parent
—

OpenAPI response schema

{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
Example
JSON
{ "detail": "Version 9999 not found." }

OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

OpenAPI operation

{
  "summary": "Deploy a prompt version",
  "operationId": "deployPromptVersion",
  "tags": [
    "Prompts"
  ],
  "description": "Deploy a committed version as the live version for this prompt.",
  "parameters": [
    {
      "name": "prompt_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "The unique prompt identifier."
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "version": {
              "type": "integer",
              "description": "Version number to deploy as live.",
              "example": 3
            }
          },
          "required": [
            "version"
          ]
        }
      }
    }
  },
  "responses": {
    "201": {
      "description": "Version deployed successfully.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "prompt_version_id": {
                "type": "string"
              },
              "version": {
                "type": "integer"
              },
              "description": {
                "type": "string",
                "nullable": true
              },
              "messages": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "model": {
                "type": "string"
              },
              "readonly": {
                "type": "boolean"
              },
              "edited_by": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "email": {
                    "type": "string"
                  },
                  "first_name": {
                    "type": "string"
                  },
                  "last_name": {
                    "type": "string"
                  }
                }
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "example": {
              "id": "pv_abc123",
              "prompt_version_id": "pv_abc123",
              "version": 3,
              "description": "Improved system prompt for better context handling",
              "messages": [
                {
                  "role": "system",
                  "content": "You are a helpful assistant. Context: {{context}}"
                }
              ],
              "model": "gpt-4o",
              "readonly": true,
              "is_deployed": true,
              "edited_by": {
                "id": 123,
                "email": "user@example.com",
                "first_name": "John",
                "last_name": "Doe"
              },
              "created_at": "2026-02-27T10:00:00Z",
              "updated_at": "2026-02-27T10:00:00Z"
            }
          }
        }
      }
    },
    "400": {
      "description": "Validation failed, or the version is a draft. Commit it first.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "description": "Maps each invalid field to its error messages, or has a `detail` message.",
            "additionalProperties": {}
          },
          "examples": {
            "draftVersion": {
              "summary": "The version is a draft",
              "value": {
                "detail": "Cannot deploy a draft version. Commit it first."
              }
            },
            "missingVersion": {
              "summary": "No version given",
              "value": {
                "version": [
                  "This field is required."
                ]
              }
            }
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    },
    "404": {
      "description": "The prompt or version doesn't exist, or the prompt has no committed version.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Version 9999 not found."
          }
        }
      }
    }
  },
  "security": [
    {
      "RespanApiKey": []
    },
    {
      "DashboardJwt": []
    }
  ]
}

OpenAPI path metadata

{}

Referenced OpenAPI components

{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "securitySchemes": {
    "DashboardJwt": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Dashboard JWT",
      "description": "Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.",
      "x-fern-bearer": {
        "name": "dashboardJwt",
        "env": "RESPAN_DASHBOARD_JWT"
      }
    },
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}