> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://devin.ferndocs.com/api-reference/v-1/update-knowledge/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://devin.ferndocs.com/_mcp/server. # Update knowledge entry PUT https://api.devin.ai/v1/knowledge/{note_id} Content-Type: application/json Update an existing knowledge entry. Reference: https://devin.ferndocs.com/api-reference/v-1/update-knowledge ## Authentication - `Authorization` header (bearer token, required) — Personal API Key (apk_user_*) or Service API Key (apk_*) ## Request ### Path parameters - `note_id` (string, required) ### Body (application/json) This endpoint expects a CreateKnowledgeParams. - `body` (string, required) - `name` (string, required) - `trigger_description` (string, required) - `macro` (string, optional, nullable) - `parent_folder_id` (string, optional, nullable) - `pinned_repo` (string, optional, nullable) ## Response ### 200 Successful Response - `body` (string, required) - `created_at` (datetime, required) - `id` (string, required) - `name` (string, required) - `trigger_description` (string, required) - `created_by` (KnowledgeCreatedBy, optional, nullable) — Information about who created a knowledge entry. - `macro` (string, optional, nullable) - `parent_folder_id` (string, optional, nullable) - `pinned_repo` (string, optional, nullable) ## Errors ### 422 Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ## Types ### KnowledgeCreatedBy Information about who created a knowledge entry. - `full_name` (string, required) - `id` (string, optional, nullable) - `image_url` (string, optional, nullable) ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItems ## Examples **Request** ```json { "body": "This knowledge entry explains the process of setting up a new project in our system, including environment configuration and deployment steps.", "name": "Project Setup Guide", "trigger_description": "Triggered when a user requests setup instructions for a new project." } ``` **Response** ```json { "body": "This knowledge entry explains the process of setting up a new project in our system, including environment configuration and deployment steps.", "created_at": "2024-01-15T09:30:00Z", "id": "note_98765", "name": "Project Setup Guide", "trigger_description": "Triggered when a user requests setup instructions for a new project.", "created_by": { "full_name": "Alice Johnson", "id": "user_12345", "image_url": "https://example.com/images/alice_johnson.png" }, "macro": "setup_macro_v2", "parent_folder_id": "folder_456", "pinned_repo": "repo_project_docs" } ``` **SDK Code** ```python import requests url = "https://api.devin.ai/v1/knowledge/note_id" payload = { "body": "This knowledge entry explains the process of setting up a new project in our system, including environment configuration and deployment steps.", "name": "Project Setup Guide", "trigger_description": "Triggered when a user requests setup instructions for a new project." } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.devin.ai/v1/knowledge/note_id'; const options = { method: 'PUT', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"body":"This knowledge entry explains the process of setting up a new project in our system, including environment configuration and deployment steps.","name":"Project Setup Guide","trigger_description":"Triggered when a user requests setup instructions for a new project."}' }; 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.devin.ai/v1/knowledge/note_id" payload := strings.NewReader("{\n \"body\": \"This knowledge entry explains the process of setting up a new project in our system, including environment configuration and deployment steps.\",\n \"name\": \"Project Setup Guide\",\n \"trigger_description\": \"Triggered when a user requests setup instructions for a new project.\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("Authorization", "Bearer ") 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.devin.ai/v1/knowledge/note_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"body\": \"This knowledge entry explains the process of setting up a new project in our system, including environment configuration and deployment steps.\",\n \"name\": \"Project Setup Guide\",\n \"trigger_description\": \"Triggered when a user requests setup instructions for a new project.\"\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.put("https://api.devin.ai/v1/knowledge/note_id") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"body\": \"This knowledge entry explains the process of setting up a new project in our system, including environment configuration and deployment steps.\",\n \"name\": \"Project Setup Guide\",\n \"trigger_description\": \"Triggered when a user requests setup instructions for a new project.\"\n}") .asString(); ``` ```php request('PUT', 'https://api.devin.ai/v1/knowledge/note_id', [ 'body' => '{ "body": "This knowledge entry explains the process of setting up a new project in our system, including environment configuration and deployment steps.", "name": "Project Setup Guide", "trigger_description": "Triggered when a user requests setup instructions for a new project." }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.devin.ai/v1/knowledge/note_id"); var request = new RestRequest(Method.PUT); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"body\": \"This knowledge entry explains the process of setting up a new project in our system, including environment configuration and deployment steps.\",\n \"name\": \"Project Setup Guide\",\n \"trigger_description\": \"Triggered when a user requests setup instructions for a new project.\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "body": "This knowledge entry explains the process of setting up a new project in our system, including environment configuration and deployment steps.", "name": "Project Setup Guide", "trigger_description": "Triggered when a user requests setup instructions for a new project." ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.devin.ai/v1/knowledge/note_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" 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() ```