> 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/secrets/retrieve-workspace-secret/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vellum.ai/_mcp/server. # Retrieve Workspace Secret GET https://api.vellum.ai/v1/workspace-secrets/{id} Used to retrieve a Workspace Secret given its ID or name. Reference: https://docs.vellum.ai/developers/client-sdk/secrets/retrieve-workspace-secret ## Authentication - `X-API-KEY` header (required) — API Key authentication via header ## Request ### Path parameters - `id` (string, required) — Either the Workspace Secret's ID or its unique name ## Response ### 200 - `id` (string, required) - `modified` (string, required) - `name` (string, required) - `label` (string, required) - `secret_type` (enum, required) — * `USER_DEFINED` - User Defined * `HMAC` - Hmac * `INTERNAL_API_KEY` - Internal Api Key * `EXTERNALLY_PROVISIONED` - Externally Provisioned - Allowed values: `USER_DEFINED`, `HMAC`, `INTERNAL_API_KEY`, `EXTERNALLY_PROVISIONED` ## Examples **Response** ```json { "id": "string", "modified": "2024-01-15T09:30:00Z", "name": "string", "label": "string", "secret_type": "USER_DEFINED" } ``` **SDK Code** ```python import requests url = "https://api.vellum.ai/v1/workspace-secrets/id" 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.workspaceSecrets.retrieve("id"); ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.vellum.ai/v1/workspace-secrets/id" 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/workspace-secrets/id") 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/workspace-secrets/id") .header("X-API-KEY", "") .asString(); ``` ```php request('GET', 'https://api.vellum.ai/v1/workspace-secrets/id', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.vellum.ai/v1/workspace-secrets/id"); 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/workspace-secrets/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() ```