# Deploy prompt to agents POST /api/agents/deployments Content-Type: application/json Simulate deployment - updates deployment records with applied state Reference: https://docs.elacity.ai/api-reference/elacity-prm-api/agents/deploy ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: openapi version: 1.0.0 paths: /agents/deployments: post: operationId: deploy summary: Deploy prompt to agents description: Simulate deployment - updates deployment records with applied state tags: - subpackage_agents parameters: - name: X-API-Key in: header description: API key for programmatic access required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Agents_deploy_Response_200' requestBody: content: application/json: schema: type: object properties: orgSlug: type: string agentIds: type: array items: type: string promptName: type: string version: type: string model: type: string environment: type: string provider: type: string toolRefs: type: array items: type: string agentVariables: type: object additionalProperties: description: Any type agentProviderConfig: type: object additionalProperties: description: Any type required: - orgSlug - agentIds - promptName - version - environment - provider servers: - url: /api components: schemas: Agents_deploy_Response_200: oneOf: - description: Any type - description: Any type title: Agents_deploy_Response_200 securitySchemes: apiKey: type: apiKey in: header name: X-API-Key description: API key for programmatic access ``` ## SDK Code Examples ```python import requests url = "https://api/agents/deployments" payload = { "orgSlug": "string", "agentIds": ["string"], "promptName": "string", "version": "string", "environment": "string", "provider": "string" } headers = { "X-API-Key": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api/agents/deployments'; const options = { method: 'POST', headers: {'X-API-Key': '', 'Content-Type': 'application/json'}, body: '{"orgSlug":"string","agentIds":["string"],"promptName":"string","version":"string","environment":"string","provider":"string"}' }; 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" "strings" "net/http" "io" ) func main() { url := "https://api/agents/deployments" payload := strings.NewReader("{\n \"orgSlug\": \"string\",\n \"agentIds\": [\n \"string\"\n ],\n \"promptName\": \"string\",\n \"version\": \"string\",\n \"environment\": \"string\",\n \"provider\": \"string\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-Key", "") req.Header.Add("Content-Type", "application/json") 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/agents/deployments") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-Key"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"orgSlug\": \"string\",\n \"agentIds\": [\n \"string\"\n ],\n \"promptName\": \"string\",\n \"version\": \"string\",\n \"environment\": \"string\",\n \"provider\": \"string\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api/agents/deployments") .header("X-API-Key", "") .header("Content-Type", "application/json") .body("{\n \"orgSlug\": \"string\",\n \"agentIds\": [\n \"string\"\n ],\n \"promptName\": \"string\",\n \"version\": \"string\",\n \"environment\": \"string\",\n \"provider\": \"string\"\n}") .asString(); ``` ```php request('POST', 'https://api/agents/deployments', [ 'body' => '{ "orgSlug": "string", "agentIds": [ "string" ], "promptName": "string", "version": "string", "environment": "string", "provider": "string" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api/agents/deployments"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-Key", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"orgSlug\": \"string\",\n \"agentIds\": [\n \"string\"\n ],\n \"promptName\": \"string\",\n \"version\": \"string\",\n \"environment\": \"string\",\n \"provider\": \"string\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-Key": "", "Content-Type": "application/json" ] let parameters = [ "orgSlug": "string", "agentIds": ["string"], "promptName": "string", "version": "string", "environment": "string", "provider": "string" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api/agents/deployments")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```