> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://respan.ai/docs/apis/prompts/get-prompt-version/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://respan.ai/_mcp/server. # Get a prompt version GET https://api.respan.ai/api/prompts/{prompt_id}/versions/{version}/ Reference: https://respan.ai/docs/apis/prompts/get-prompt-version ## Authentication - `Authorization` header (bearer token, required) — Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer \. 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. - `Authorization` header (bearer token, required) — Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead. ## Request ### Path parameters - `prompt_id` (string, required) — The unique prompt identifier. - `version` (integer, required) — The prompt version number. ## Response ### 200 Prompt version details. - `id` (string, optional) - `prompt_version_id` (string, optional) - `version` (integer, optional) - `description` (string, optional, nullable) - `messages` (list of map from string to any, optional) - `thinking` (ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaThinking, optional, nullable) - `model` (string, optional) - `stream` (boolean, optional) - `temperature` (double, optional, nullable) - `max_tokens` (integer, optional, nullable) - `top_p` (double, optional, nullable) - `frequency_penalty` (double, optional, nullable) - `presence_penalty` (double, optional, nullable) - `reasoning_effort` (string, optional, nullable) - `verbosity` (string, optional, nullable) - `seed` (integer, optional, nullable) - `variables` (ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaVariables, optional) - `fallback_models` (list of string, optional, nullable) - `load_balance_models` (list of ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaLoadBalanceModelsItems, optional, nullable) - `tools` (list of ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaToolsItems, optional, nullable) - `tool_choice` (ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaToolChoice, optional) - `response_format` (ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaResponseFormat, optional, nullable) - `json_schema` (ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaJsonSchema, optional, nullable) - `is_enforcing_response_format` (boolean, optional) - `readonly` (boolean, optional) - `edited_by` (ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaEditedBy, optional) - `created_at` (datetime, optional) - `updated_at` (datetime, optional) ## Errors ### 403 Forbidden Error The API key is missing, invalid or expired. - `detail` (string, required) ### 404 Not Found Error Version not found - `detail` (string, required) ## Types ### ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaThinking ### ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaVariables ### ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaLoadBalanceModelsItems ### ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaToolsItems ### ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaToolChoice ### ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaResponseFormat ### ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaJsonSchema ### ApiPromptsPromptIdVersionsVersionGetResponsesContentApplicationJsonSchemaEditedBy - `id` (integer, optional) - `email` (string, optional) - `first_name` (string, optional) - `last_name` (string, optional) ## Examples **Response** ```json { "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, "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", "is_deployed": false } ``` **SDK Code** ```python import requests url = "https://api.respan.ai/api/prompts/prompt_id/versions/3/" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.respan.ai/api/prompts/prompt_id/versions/3/'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.respan.ai/api/prompts/prompt_id/versions/3/" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.respan.ai/api/prompts/prompt_id/versions/3/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.respan.ai/api/prompts/prompt_id/versions/3/") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.respan.ai/api/prompts/prompt_id/versions/3/', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.respan.ai/api/prompts/prompt_id/versions/3/"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.respan.ai/api/prompts/prompt_id/versions/3/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```