# Update tool PATCH /api/tools/{toolId} Content-Type: application/json Update an existing tool Reference: https://docs.elacity.ai/api-reference/elacity-prm-api/tools/prm-tools-update ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: openapi version: 1.0.0 paths: /tools/{toolId}: patch: operationId: prm-tools-update summary: Update tool description: Update an existing tool tags: - subpackage_tools parameters: - name: toolId in: path required: true schema: type: string - 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/Tools_prm.tools.update_Response_200' requestBody: content: application/json: schema: type: object properties: name: type: string description: type: string prompt: type: string type: type: string providerConfig: type: object additionalProperties: description: Any type version: type: string bumpVersion: $ref: >- #/components/schemas/ToolsToolIdPatchRequestBodyContentApplicationJsonSchemaBumpVersion updateEnvironmentVersions: type: array items: type: string servers: - url: /api components: schemas: ToolsToolIdPatchRequestBodyContentApplicationJsonSchemaBumpVersion: type: string enum: - major - minor - patch title: ToolsToolIdPatchRequestBodyContentApplicationJsonSchemaBumpVersion Tools_prm.tools.update_Response_200: oneOf: - description: Any type - description: Any type title: Tools_prm.tools.update_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/tools/toolId" payload = {} headers = { "X-API-Key": "", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api/tools/toolId'; const options = { method: 'PATCH', headers: {'X-API-Key': '', 'Content-Type': 'application/json'}, body: '{}' }; 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/tools/toolId" payload := strings.NewReader("{}") req, _ := http.NewRequest("PATCH", 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/tools/toolId") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["X-API-Key"] = '' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api/tools/toolId") .header("X-API-Key", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('PATCH', 'https://api/tools/toolId', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api/tools/toolId"); var request = new RestRequest(Method.PATCH); request.AddHeader("X-API-Key", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-Key": "", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api/tools/toolId")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" 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() ```