跳转到主要内容
PUT
/
v1
/
knowledge
/
{note_id}
更新 Knowledge 条目
curl --request PUT \
  --url https://api.devin.ai/v1/knowledge/{note_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "body": "<string>",
  "name": "<string>",
  "trigger_description": "<string>",
  "macro": "<string>",
  "parent_folder_id": "<string>",
  "pinned_repo": "<string>"
}
'
import requests

url = "https://api.devin.ai/v1/knowledge/{note_id}"

payload = {
"body": "<string>",
"name": "<string>",
"trigger_description": "<string>",
"macro": "<string>",
"parent_folder_id": "<string>",
"pinned_repo": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
body: JSON.stringify('<string>'),
name: '<string>',
trigger_description: '<string>',
macro: '<string>',
parent_folder_id: '<string>',
pinned_repo: '<string>'
})
};

fetch('https://api.devin.ai/v1/knowledge/{note_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v1/knowledge/{note_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'body' => '<string>',
'name' => '<string>',
'trigger_description' => '<string>',
'macro' => '<string>',
'parent_folder_id' => '<string>',
'pinned_repo' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.devin.ai/v1/knowledge/{note_id}"

payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"name\": \"<string>\",\n \"trigger_description\": \"<string>\",\n \"macro\": \"<string>\",\n \"parent_folder_id\": \"<string>\",\n \"pinned_repo\": \"<string>\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.devin.ai/v1/knowledge/{note_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"name\": \"<string>\",\n \"trigger_description\": \"<string>\",\n \"macro\": \"<string>\",\n \"parent_folder_id\": \"<string>\",\n \"pinned_repo\": \"<string>\"\n}")
.asString();
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 <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"body\": \"<string>\",\n \"name\": \"<string>\",\n \"trigger_description\": \"<string>\",\n \"macro\": \"<string>\",\n \"parent_folder_id\": \"<string>\",\n \"pinned_repo\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "body": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "name": "<string>",
  "trigger_description": "<string>",
  "created_by": {
    "full_name": "<string>",
    "id": "<string>",
    "image_url": "<string>"
  },
  "macro": "<string>",
  "parent_folder_id": "<string>",
  "pinned_repo": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

授权

Authorization
string
header
必填

个人 API Key(apk_user_*)或服务 API Key(apk_*)

路径参数

note_id
string
必填

请求体

application/json
body
string
必填
name
string
必填
trigger_description
string
必填
macro
string | null
parent_folder_id
string | null
pinned_repo
string | null

响应

成功的响应

body
string
必填
created_at
string<date-time>
必填
id
string
必填
name
string
必填
trigger_description
string
必填
created_by
KnowledgeCreatedBy · object | null

有关 Knowledge 条目创建者的信息。

macro
string | null
parent_folder_id
string | null
pinned_repo
string | null