> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.vellum.ai/developers/client-sdk/prompts/pull/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vellum.ai/_mcp/server. # Pull Prompt GET https://api.vellum.ai/v1/prompts/{id}/pull Used to pull the definition of a Prompt from Vellum. Reference: https://docs.vellum.ai/developers/client-sdk/prompts/pull ## Authentication - `X-API-KEY` header (required) — API Key authentication via header ## Request ### Path parameters - `id` (string, required) — The ID of the Prompt to pull from. Prompt Deployment IDs or names, Prompt Sandbox IDs, and Prompt Version IDs are currently supported. ### Query parameters - `prompt_variant_id` (string, optional) — The ID of the Prompt Variant within a Prompt Sandbox to pull. Must be included if providing the ID of a Prompt Sandbox. - `release_tag` (string, optional) — The Release Tag to pull when providing a Prompt Deployment ID or name. Defaults to LATEST. ### Headers - `Accept` (string, optional, default: application/json) — Set to 'application/yaml' to receive YAML response, otherwise JSON will be returned ## Response ### 200 - `ml_model` (string, required) - `input_variables` (list of VellumVariable, required) - `parameters` (PromptParameters, required) - `blocks` (list of PromptBlock, required) - `settings` (PromptSettings, optional, nullable) - `functions` (list of FunctionDefinition, optional, nullable) ## Errors ### 400 Bad Request Error - `map from string to any` ### 404 Not Found Error - `map from string to any` ## Types ### VellumVariable - `id` (string, required) - `key` (string, required) - `type` (enum, required) — * `STRING` - STRING * `NUMBER` - NUMBER * `JSON` - JSON * `CHAT_HISTORY` - CHAT_HISTORY * `SEARCH_RESULTS` - SEARCH_RESULTS * `ERROR` - ERROR * `ARRAY` - ARRAY * `FUNCTION_CALL` - FUNCTION_CALL * `AUDIO` - AUDIO * `VIDEO` - VIDEO * `IMAGE` - IMAGE * `DOCUMENT` - DOCUMENT * `NULL` - NULL * `THINKING` - THINKING * `REFERENCE` - REFERENCE - Allowed values: `STRING`, `NUMBER`, `JSON`, `CHAT_HISTORY`, `SEARCH_RESULTS`, `ERROR`, `ARRAY`, `FUNCTION_CALL`, `AUDIO`, `VIDEO`, `IMAGE`, `DOCUMENT`, `NULL`, `THINKING`, `REFERENCE` - `required` (boolean, optional, nullable) - `default` (VellumValue, optional, nullable) - `extensions` (VellumVariableExtensions, optional, nullable) — A set of fields with additional properties for use in Vellum Variables. - `schema` (map from string to any, optional, nullable) ### PromptParameters - `stop` (list of string, optional, nullable) - `temperature` (double, optional, nullable) - `max_tokens` (integer, optional, nullable) - `top_p` (double, optional, nullable) - `top_k` (integer, optional, nullable) - `frequency_penalty` (double, optional, nullable) - `presence_penalty` (double, optional, nullable) - `logit_bias` (map from string to double, optional, nullable) - `custom_parameters` (map from string to any, optional, nullable) ### PromptBlock ### PromptSettings - `timeout` (double, optional, nullable) - `stream_enabled` (boolean, optional, nullable) ### FunctionDefinition The definition of a Function (aka "Tool Call") that a Prompt/Model has access to. - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) - `name` (string, optional, nullable) — The name identifying the function. - `description` (string, optional, nullable) — A description to help guide the model when to invoke this function. - `parameters` (map from string to any, optional, nullable) — An OpenAPI specification of parameters that are supported by this function. - `inputs` (map from string to any, optional, nullable) — Optional user defined input mappings for this function. - `forced` (boolean, optional, nullable, default: false) — Set this option to true to force the model to return a function call of this function. - `strict` (boolean, optional, nullable, default: false) — Set this option to use strict schema decoding when available. ### VellumValue ### VellumVariableExtensions A set of fields with additional properties for use in Vellum Variables. - `color` (string, optional, nullable) - `description` (string, optional, nullable) - `title` (string, optional, nullable) ### JinjaPromptBlock A block of Jinja template code that is used to generate a prompt - `block_type` (enum, required) - Allowed values: `JINJA` - `template` (string, required) - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) ### ChatMessagePromptBlock A block that represents a chat message in a prompt template. - `block_type` (enum, required) - Allowed values: `CHAT_MESSAGE` - `chat_role` (enum, required) — * `SYSTEM` - System * `ASSISTANT` - Assistant * `USER` - User * `FUNCTION` - Function - Allowed values: `SYSTEM`, `ASSISTANT`, `USER`, `FUNCTION` - `blocks` (list of PromptBlock, required) - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) - `chat_source` (string, optional, nullable) - `chat_message_unterminated` (boolean, optional, default: false) ### VariablePromptBlock A block that represents a variable in a prompt template. - `block_type` (enum, required) - Allowed values: `VARIABLE` - `input_variable` (string, required) - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) ### RichTextPromptBlock A block that includes a combination of plain text and variable blocks. - `block_type` (enum, required) - Allowed values: `RICH_TEXT` - `blocks` (list of RichTextChildBlock, required) - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) ### FunctionCallPromptBlock A block that represents a function call in a prompt template. - `block_type` (enum, required) - Allowed values: `FUNCTION_CALL` - `name` (string, required) - `arguments` (map from string to any, required) - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) - `id` (string, optional, nullable) ### AudioPromptBlock A block that represents an audio file in a prompt template. - `block_type` (enum, required) - Allowed values: `AUDIO` - `src` (string, required) - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) - `metadata` (map from string to any, optional, nullable) ### VideoPromptBlock A block that represents an video file in a prompt template. - `block_type` (enum, required) - Allowed values: `VIDEO` - `src` (string, required) - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) - `metadata` (map from string to any, optional, nullable) ### ImagePromptBlock A block that represents an image in a prompt template. - `block_type` (enum, required) - Allowed values: `IMAGE` - `src` (string, required) - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) - `metadata` (map from string to any, optional, nullable) ### DocumentPromptBlock A block that represents a document in a prompt template. - `block_type` (enum, required) - Allowed values: `DOCUMENT` - `src` (string, required) - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) - `metadata` (map from string to any, optional, nullable) ### EphemeralPromptCacheConfig - `type` (enum, optional) — * `EPHEMERAL` - EPHEMERAL - Allowed values: `EPHEMERAL` ### StringVellumValue A value representing a string. - `type` (enum, required) - Allowed values: `STRING` - `value` (string, required, nullable) ### NumberVellumValue A value representing a number. - `type` (enum, required) - Allowed values: `NUMBER` - `value` (double, required, nullable) ### JsonVellumValue A value representing a JSON object. - `type` (enum, required) - Allowed values: `JSON` - `value` (any, required, nullable) ### AudioVellumValue A base Vellum primitive value representing audio. - `type` (enum, required) - Allowed values: `AUDIO` - `value` (VellumAudio, required, nullable) ### VideoVellumValue A base Vellum primitive value representing a video. - `type` (enum, required) - Allowed values: `VIDEO` - `value` (VellumVideo, required, nullable) ### ImageVellumValue A base Vellum primitive value representing an image. - `type` (enum, required) - Allowed values: `IMAGE` - `value` (VellumImage, required, nullable) ### DocumentVellumValue A base Vellum primitive value representing a document. - `type` (enum, required) - Allowed values: `DOCUMENT` - `value` (VellumDocument, required, nullable) ### FunctionCallVellumValue A value representing a Function Call. - `type` (enum, required) - Allowed values: `FUNCTION_CALL` - `value` (FunctionCall, required, nullable) — The final resolved function call value. ### ErrorVellumValue A value representing an Error. - `type` (enum, required) - Allowed values: `ERROR` - `value` (VellumError, required, nullable) ### ArrayVellumValue A value representing an array of Vellum variable values. - `type` (enum, required) - Allowed values: `ARRAY` - `value` (list of VellumValue, required, nullable) ### ChatHistoryVellumValue A value representing Chat History. - `type` (enum, required) - Allowed values: `CHAT_HISTORY` - `value` (list of ChatMessage, required, nullable) ### SearchResultsVellumValue A value representing Search Results. - `type` (enum, required) - Allowed values: `SEARCH_RESULTS` - `value` (list of SearchResult, required, nullable) ### ThinkingVellumValue A value representing Thinking mode output. - `type` (enum, required) - Allowed values: `THINKING` - `value` (StringVellumValue, required, nullable) — A value representing a string. ### RichTextChildBlock ### VellumAudio - `src` (string, required) — The reference to the source data. This can be one of the following formats: 1. A base64-encoded data URL (e.g., 'data:application/pdf;base64,JVBERi0xLjQKJcfs...'). 2. A url pointing to a file accessible over HTTP or HTTPS. 3. A reference to a file that's been previously uploaded to Vellum, in the form of 'vellum:uploaded-file:\{uploaded\_file\_id}'. You can use the Uploaded Files API to retrieve the url of the uploaded file given its ID. See [https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve](https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve) for details. - `metadata` (map from string to any, optional, nullable) ### VellumVideo - `src` (string, required) — The reference to the source data. This can be one of the following formats: 1. A base64-encoded data URL (e.g., 'data:application/pdf;base64,JVBERi0xLjQKJcfs...'). 2. A url pointing to a file accessible over HTTP or HTTPS. 3. A reference to a file that's been previously uploaded to Vellum, in the form of 'vellum:uploaded-file:\{uploaded\_file\_id}'. You can use the Uploaded Files API to retrieve the url of the uploaded file given its ID. See [https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve](https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve) for details. - `metadata` (map from string to any, optional, nullable) ### VellumImage - `src` (string, required) — The reference to the source data. This can be one of the following formats: 1. A base64-encoded data URL (e.g., 'data:application/pdf;base64,JVBERi0xLjQKJcfs...'). 2. A url pointing to a file accessible over HTTP or HTTPS. 3. A reference to a file that's been previously uploaded to Vellum, in the form of 'vellum:uploaded-file:\{uploaded\_file\_id}'. You can use the Uploaded Files API to retrieve the url of the uploaded file given its ID. See [https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve](https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve) for details. - `metadata` (map from string to any, optional, nullable) ### VellumDocument - `src` (string, required) — The reference to the source data. This can be one of the following formats: 1. A base64-encoded data URL (e.g., 'data:application/pdf;base64,JVBERi0xLjQKJcfs...'). 2. A url pointing to a file accessible over HTTP or HTTPS. 3. A reference to a file that's been previously uploaded to Vellum, in the form of 'vellum:uploaded-file:\{uploaded\_file\_id}'. You can use the Uploaded Files API to retrieve the url of the uploaded file given its ID. See [https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve](https://docs.vellum.ai/developers/client-sdk/uploaded-files/retrieve) for details. - `metadata` (map from string to any, optional, nullable) ### FunctionCall The final resolved function call value. - `arguments` (map from string to any, required) - `name` (string, required) - `id` (string, optional, nullable) ### VellumError - `code` (enum, required) — * `INVALID_REQUEST` - INVALID_REQUEST * `INVALID_INPUTS` - INVALID_INPUTS * `PROVIDER_ERROR` - PROVIDER_ERROR * `PROVIDER_CREDENTIALS_UNAVAILABLE` - PROVIDER_CREDENTIALS_UNAVAILABLE * `INTEGRATION_CREDENTIALS_UNAVAILABLE` - INTEGRATION_CREDENTIALS_UNAVAILABLE * `REQUEST_TIMEOUT` - REQUEST_TIMEOUT * `INTERNAL_SERVER_ERROR` - INTERNAL_SERVER_ERROR * `USER_DEFINED_ERROR` - USER_DEFINED_ERROR * `WORKFLOW_CANCELLED` - WORKFLOW_CANCELLED * `NODE_CANCELLED` - NODE_CANCELLED * `PROVIDER_QUOTA_EXCEEDED` - PROVIDER_QUOTA_EXCEEDED * `CHAT_QUOTA_EXCEEDED` - CHAT_QUOTA_EXCEEDED - Allowed values: `INVALID_REQUEST`, `INVALID_INPUTS`, `PROVIDER_ERROR`, `PROVIDER_CREDENTIALS_UNAVAILABLE`, `INTEGRATION_CREDENTIALS_UNAVAILABLE`, `REQUEST_TIMEOUT`, `INTERNAL_SERVER_ERROR`, `USER_DEFINED_ERROR`, `WORKFLOW_CANCELLED`, `NODE_CANCELLED`, `PROVIDER_QUOTA_EXCEEDED`, `CHAT_QUOTA_EXCEEDED` - `message` (string, required) - `raw_data` (map from string to any, optional, nullable) ### ChatMessage - `role` (enum, required) — * `SYSTEM` - System * `ASSISTANT` - Assistant * `USER` - User * `FUNCTION` - Function - Allowed values: `SYSTEM`, `ASSISTANT`, `USER`, `FUNCTION` - `text` (string, optional, nullable) - `content` (ChatMessageContent, optional, nullable) - `source` (string, optional, nullable) — An optional identifier representing who or what generated this message. - `metadata` (map from string to any, optional, nullable) ### SearchResult - `text` (string, required) — The text of the chunk that matched the search query. - `score` (double, required) — A score representing how well the chunk matches the search query. - `keywords` (list of string, required) - `document` (SearchResultDocument, required) — The document that contains the chunk that matched the search query. - `meta` (SearchResultMeta, optional, nullable) — Additional information about the search result. ### PlainTextPromptBlock A block that holds a plain text string value. - `block_type` (enum, required) - Allowed values: `PLAIN_TEXT` - `text` (string, required) - `state` (enum, optional) — * `ENABLED` - Enabled * `DISABLED` - Disabled - Allowed values: `ENABLED`, `DISABLED` - `cache_config` (EphemeralPromptCacheConfig, optional, nullable) ### ChatMessageContent ### SearchResultDocument - `label` (string, required) — The human-readable name for the document. - `id` (string, optional, nullable) — The ID of the document. - `external_id` (string, optional, nullable) — The unique ID of the document as represented in an external system and specified when it was originally uploaded. - `metadata` (map from string to any, optional, nullable) — A previously supplied JSON object containing metadata that can be filtered on when searching. ### SearchResultMeta - `source` (SearchResultMetaSource, optional, nullable) ### StringChatMessageContent A string value that is used in a chat message. - `type` (enum, required) - Allowed values: `STRING` - `value` (string, required) ### FunctionCallChatMessageContent A function call value that is used in a chat message. - `type` (enum, required) - Allowed values: `FUNCTION_CALL` - `value` (FunctionCallChatMessageContentValue, required) — The final resolved function call value. ### ArrayChatMessageContent A list of chat message content items. - `type` (enum, required) - Allowed values: `ARRAY` - `value` (list of ArrayChatMessageContentItem, required) ### AudioChatMessageContent An audio value that is used in a chat message. - `type` (enum, required) - Allowed values: `AUDIO` - `value` (VellumAudio, required) ### VideoChatMessageContent A video value that is used in a chat message. - `type` (enum, required) - Allowed values: `VIDEO` - `value` (VellumVideo, required) ### ImageChatMessageContent An image value that is used in a chat message. - `type` (enum, required) - Allowed values: `IMAGE` - `value` (VellumImage, required) ### DocumentChatMessageContent A document value that is used in a chat message. - `type` (enum, required) - Allowed values: `DOCUMENT` - `value` (VellumDocument, required) ### SearchResultMetaSource ### FunctionCallChatMessageContentValue The final resolved function call value. - `name` (string, required) - `arguments` (map from string to any, required) - `id` (string, optional, nullable) ### ArrayChatMessageContentItem ### PdfSearchResultMetaSource The source of a search result from a PDF document. - `document_type` (enum, required) - Allowed values: `PDF` - `start_page_num` (integer, required, nullable) — The 1-indexed page number where the chunk starts in the document. Only available for supported chunking strategies and document types. - `end_page_num` (integer, required, nullable) — The 1-indexed page number where the chunk ends in the document. Only available for supported chunking strategies and document types. ## Examples **Response** ```json { "ml_model": "string", "input_variables": [ { "id": "string", "key": "string", "type": "STRING", "required": true, "default": { "type": "STRING", "value": "string" }, "extensions": { "color": "string", "description": "string", "title": "string" }, "schema": {} } ], "parameters": { "stop": [ "string" ], "temperature": 1.1, "max_tokens": 1, "top_p": 1.1, "top_k": 1, "frequency_penalty": 1.1, "presence_penalty": 1.1, "logit_bias": {}, "custom_parameters": {} }, "blocks": [ { "block_type": "JINJA", "state": "ENABLED", "cache_config": { "type": "EPHEMERAL" }, "template": "string" } ], "settings": { "timeout": 1.1, "stream_enabled": true }, "functions": [ { "state": "ENABLED", "cache_config": { "type": "EPHEMERAL" }, "name": "string", "description": "string", "parameters": {}, "inputs": {}, "forced": false, "strict": false } ] } ``` **SDK Code** ```python import requests url = "https://api.vellum.ai/v1/prompts/id/pull" headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript import { VellumClient } from "vellum-ai"; const client = new VellumClient({ apiKey: "YOUR_API_KEY", apiVersion: "YOUR_API_VERSION" }); await client.prompts.pull("id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.vellum.ai/v1/prompts/id/pull" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-API-KEY", "") 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.vellum.ai/v1/prompts/id/pull") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-API-KEY"] = '' 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.vellum.ai/v1/prompts/id/pull") .header("X-API-KEY", "") .asString(); ``` ```php request('GET', 'https://api.vellum.ai/v1/prompts/id/pull', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.vellum.ai/v1/prompts/id/pull"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.vellum.ai/v1/prompts/id/pull")! 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() ```