Skip to Content

Get a prompt

GEThttps://api.respan.ai/api/prompts/{prompt_id}/

Returns the prompt template with its current and live versions.

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.

Responses

200

Prompt details.

application/json

Field Type Requirement Description and constraints
$ object Body
Example: {"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"}
id string Optional
The unique prompt identifier.
name string Optional
-
description string or null Optional
-
prompt_slug string or null Optional
-
tags array<object> Optional
-
tags[] object Array item
-
tags[].id string Optional
-
tags[].name string Optional
-
tags[].color string Optional
-
tags[].created_at string Optional
Format: date-time
tags[].updated_at string Optional
Format: date-time
current_version object or null Optional
The prompt’s current version, as the full version object that Get a prompt version returns.
current_version.version integer Optional
-
current_version.model string Optional
-
current_version.updated_at string Optional
Format: date-time
live_version object or null Optional
The deployed version, as the full version object that Get a prompt version returns. null until a version is deployed.
live_version.version integer Optional
-
live_version.model string Optional
-
live_version.updated_at string Optional
Format: date-time

OpenAPI response schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique prompt identifier."
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string",
      "nullable": true
    },
    "prompt_slug": {
      "type": "string",
      "nullable": true
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "current_version": {
      "type": "object",
      "nullable": true,
      "properties": {
        "version": {
          "type": "integer"
        },
        "model": {
          "type": "string"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "The prompt's current version, as the full version object that Get a prompt version returns."
    },
    "live_version": {
      "type": "object",
      "nullable": true,
      "properties": {
        "version": {
          "type": "integer"
        },
        "model": {
          "type": "string"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "The deployed version, as the full version object that Get a prompt version returns. `null` until a version is deployed."
    }
  },
  "example": {
    "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"
  }
}

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

Prompt not found

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": "Prompt not found" }

OpenAPI source

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

OpenAPI operation

{
  "summary": "Get a prompt",
  "operationId": "retrievePrompt",
  "tags": [
    "Prompts"
  ],
  "description": "Returns the prompt template with its current and live versions.",
  "parameters": [
    {
      "name": "prompt_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "The unique prompt identifier."
    }
  ],
  "responses": {
    "200": {
      "description": "Prompt details.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The unique prompt identifier."
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string",
                "nullable": true
              },
              "prompt_slug": {
                "type": "string",
                "nullable": true
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "color": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              },
              "current_version": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "version": {
                    "type": "integer"
                  },
                  "model": {
                    "type": "string"
                  },
                  "updated_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "description": "The prompt's current version, as the full version object that Get a prompt version returns."
              },
              "live_version": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "version": {
                    "type": "integer"
                  },
                  "model": {
                    "type": "string"
                  },
                  "updated_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "description": "The deployed version, as the full version object that Get a prompt version returns. `null` until a version is deployed."
              }
            },
            "example": {
              "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"
            }
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    },
    "404": {
      "description": "Prompt not found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Prompt 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"
      }
    }
  }
}