> 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/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://respan.ai/_mcp/server. # Get a prompt GET https://api.respan.ai/api/prompts/{prompt_id}/ Returns the prompt template with its current and live versions. Reference: https://respan.ai/docs/apis/prompts/get-prompt ## 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. ## Response ### 200 Prompt details. - `id` (string, optional) — The unique prompt identifier. - `name` (string, optional) - `description` (string, optional, nullable) - `prompt_slug` (string, optional, nullable) - `tags` (list of ApiPromptsPromptIdGetResponsesContentApplicationJsonSchemaTagsItems, optional) - `current_version` (ApiPromptsPromptIdGetResponsesContentApplicationJsonSchemaCurrentVersion, optional, nullable) — The prompt's current version, as the full version object that Get a prompt version returns. - `live_version` (ApiPromptsPromptIdGetResponsesContentApplicationJsonSchemaLiveVersion, optional, nullable) — The deployed version, as the full version object that Get a prompt version returns. `null` until a version is deployed. ## Errors ### 403 Forbidden Error The API key is missing, invalid or expired. - `detail` (string, required) ### 404 Not Found Error Prompt not found - `detail` (string, required) ## Types ### ApiPromptsPromptIdGetResponsesContentApplicationJsonSchemaTagsItems - `id` (string, optional) - `name` (string, optional) - `color` (string, optional) - `created_at` (datetime, optional) - `updated_at` (datetime, optional) ### ApiPromptsPromptIdGetResponsesContentApplicationJsonSchemaCurrentVersion The prompt's current version, as the full version object that Get a prompt version returns. - `version` (integer, optional) - `model` (string, optional) - `updated_at` (datetime, optional) ### ApiPromptsPromptIdGetResponsesContentApplicationJsonSchemaLiveVersion The deployed version, as the full version object that Get a prompt version returns. `null` until a version is deployed. - `version` (integer, optional) - `model` (string, optional) - `updated_at` (datetime, optional) ## Examples **Response** ```json { "id": "prompt_abc123", "name": "Customer Support Assistant", "description": "Handles customer support queries with empathy", "prompt_slug": "customer-support-assistant", "tags": [ { "id": "tag_abc123", "name": "support", "color": "#3B82F6", "created_at": "2026-01-01T00:00:00Z", "updated_at": "2026-01-01T00:00:00Z" } ], "current_version": { "version": 3, "model": "gpt-4o", "updated_at": "2026-01-20T10:30:00Z" }, "live_version": { "version": 2, "model": "gpt-4o-mini", "updated_at": "2026-01-15T08:00:00Z" }, "created_at": "2026-01-01T00:00:00Z", "updated_at": "2026-01-20T10:30:00Z" } ``` **SDK Code** ```python import requests url = "https://api.respan.ai/api/prompts/prompt_id/" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.respan.ai/api/prompts/prompt_id/'; 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/" 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/") 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/") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.respan.ai/api/prompts/prompt_id/', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.respan.ai/api/prompts/prompt_id/"); 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/")! 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() ```