Prompts

Update a prompt version

Changed on

Set deploy: true to make this version live immediately.

patch/api/prompts/{prompt_id}/versions/{version}/

Request

  • Base URL
    https://api.respan.ai
  • URL
    https://api.respan.ai/api/prompts/{prompt_id}/versions/{version}/
  • Auth
    • HTTP bearer
    • or HTTP bearer

Path parameters

prompt_idstring required

The unique prompt identifier.

versioninteger required

The prompt version number.

Request body

descriptionstring

Version description.

thinkingobject nullable

Optional provider-specific reasoning configuration.

modelstring

Primary model for this version.

streamboolean

Whether to stream responses.

temperaturenumber

Sampling temperature (0-2).

max_tokensinteger

Maximum tokens to generate.

top_pnumber

Nucleus sampling parameter.

frequency_penaltynumber

Frequency penalty (-2 to 2).

presence_penaltynumber

Presence penalty (-2 to 2).

reasoning_effortstring nullable
verbositystring nullable
seedinteger nullable
variablesobject

Template variables and their default values.

fallback_modelsstring[]

Fallback models if the primary model fails.

load_balance_modelsobject[]

Weighted load-balancing model configuration.

toolsobject[]

Tools available to the model.

response_formatobject nullable

Structured output / response format configuration.

json_schemaobject nullable

JSON schema used for structured outputs when configured.

is_enforcing_response_formatboolean

Whether to strictly enforce the response format.

deployboolean

Deploy this version as the live version immediately.

Example request

{
  "description": "Production version with context awareness",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful customer support assistant. Context: {{context}}"
    },
    {
      "role": "user",
      "content": "{{user_query}}"
    }
  ],
  "model": "gpt-6-luna",
  "temperature": 0.7,
  "max_tokens": 2048,
  "variables": {
    "context": "Product information and FAQs",
    "user_query": "How do I reset my password?"
  },
  "fallback_models": [
    "claude-haiku-5-5"
  ],
  "load_balance_models": [
    {
      "model": "gpt-6-luna",
      "weight": 0.8
    },
    {
      "model": "claude-haiku-5-5",
      "weight": 0.2
    }
  ],
  "deploy": false
}

Response

Prompt version updated successfully.

idstring
prompt_version_idstring
versioninteger
descriptionstring nullable
thinkingobject nullable
modelstring
streamboolean
temperaturenumber nullable
max_tokensinteger nullable
top_pnumber nullable
frequency_penaltynumber nullable
presence_penaltynumber nullable
reasoning_effortstring nullable
verbositystring nullable
seedinteger nullable
variablesobject
fallback_modelsstring[] nullable
load_balance_modelsobject[] nullable
toolsobject[] nullable
response_formatobject nullable
json_schemaobject nullable
is_enforcing_response_formatboolean
readonlyboolean
created_atstring date-time
updated_atstring date-time

Example response

{
  "id": "pv_abc123",
  "prompt_version_id": "pv_abc123",
  "version": 3,
  "description": "Added context variable",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant. Context: {{context}}"
    },
    {
      "role": "user",
      "content": "{{user_query}}"
    }
  ],
  "thinking": null,
  "model": "gpt-4o",
  "stream": false,
  "temperature": 0.7,
  "max_tokens": 2048,
  "top_p": 1,
  "frequency_penalty": 0,
  "presence_penalty": 0,
  "reasoning_effort": null,
  "verbosity": null,
  "seed": null,
  "variables": {
    "context": "",
    "user_query": ""
  },
  "fallback_models": [
    "gpt-4o-mini"
  ],
  "load_balance_models": [
    {
      "model": "gpt-4o",
      "weight": 0.8
    },
    {
      "model": "gpt-4o-mini",
      "weight": 0.2
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "search_knowledge_base"
      }
    }
  ],
  "tool_choice": "auto",
  "response_format": null,
  "json_schema": null,
  "is_enforcing_response_format": false,
  "readonly": false,
  "is_deployed": false,
  "edited_by": {
    "id": 123,
    "email": "user@example.com",
    "first_name": "John",
    "last_name": "Doe"
  },
  "created_at": "2026-01-20T10:30:00Z",
  "updated_at": "2026-01-20T10:30:00Z"
}

Changes

    • breaking

      request body became required

    • breaking

      removed subschema #2 from the request property oneOf list

    • breaking

      removed subschema #2 from the request property oneOf list

    • breaking

      removed subschema #2 from the request property oneOf list

    • breaking

      removed subschema #1 subschema #2 from the // request property oneOf list

    • breaking

      removed subschema #1 subschema #2 from the request property oneOf list

    • breaking

      the request property type changed from no type to object

    • breaking

      the request property type changed from no type to object

    • breaking

      the request property type changed from no type to object

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      added subschema #1 subschema #2 to the // response property oneOf list for the response status

    • breaking

      added subschema #1 subschema #2 to the response property oneOf list for the response status

    • breaking

      the response's property type changed from number null to number, and format from double to no format for status

    • breaking

      the response's property type changed from no type to object for status

    • breaking

      the response's property type changed from number null to number, and format from double to no format for status

    • breaking

      the response's property type changed from no type to object for status

    • breaking

      the response's property type changed from number null to number, and format from double to no format for status

    • breaking

      the response's property type changed from no type to object for status

    • breaking

      the response's property type changed from number null to number, and format from double to no format for status

    • info

      api operation id prompts_updatePromptVersion removed and replaced with updatePromptVersion

    • info

      the endpoint scheme security DashboardJwt was added to the API

    • info

      api tag Prompts added

    • info

      api tag prompts removed

    • info

      the request property became nullable

    • info

      the request property became nullable

    • info

      the request property became nullable

    • info

      the request property became nullable

    • info

      the request property became nullable

    • info

      the request property became nullable

    • info

      added subschema #1 subschema #2 to the // request property oneOf list

    • info

      added subschema #1 subschema #2 to the request property oneOf list

    • info

      the request property format was generalized from double to no format

    • info

      the request property format was generalized from double to no format

    • info

      the request property format was generalized from double to no format

    • info

      the request property format was generalized from double to no format

    • info

      removed subschema #2 from the response property oneOf list for the response status

    • info

      removed subschema #2 from the response property oneOf list for the response status

    • info

      removed subschema #2 from the response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 from the // response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 from the response property oneOf list for the response status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      added the required property to the response with the status