Update a Skill
curl --request PATCH \
--url https://api.langdock.com/skills/v1/{skillId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"instructions": "<string>",
"integrationIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.langdock.com/skills/v1/{skillId}"
payload = {
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"instructions": "<string>",
"integrationIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
description: '<string>',
instructions: '<string>',
integrationIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.langdock.com/skills/v1/{skillId}', 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.langdock.com/skills/v1/{skillId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'instructions' => '<string>',
'integrationIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.langdock.com/skills/v1/{skillId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"integrationIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.langdock.com/skills/v1/{skillId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"integrationIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/skills/v1/{skillId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"integrationIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"skill": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"instructions": "<string>",
"integrationIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Skills API
Skill aktualisieren
Aktualisiere einen bestehenden Skill
PATCH
/
skills
/
v1
/
{skillId}
Update a Skill
curl --request PATCH \
--url https://api.langdock.com/skills/v1/{skillId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"instructions": "<string>",
"integrationIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.langdock.com/skills/v1/{skillId}"
payload = {
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"instructions": "<string>",
"integrationIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
description: '<string>',
instructions: '<string>',
integrationIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.langdock.com/skills/v1/{skillId}', 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.langdock.com/skills/v1/{skillId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'instructions' => '<string>',
'integrationIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.langdock.com/skills/v1/{skillId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"integrationIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.langdock.com/skills/v1/{skillId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"integrationIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/skills/v1/{skillId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"integrationIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"skill": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"instructions": "<string>",
"integrationIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Nutzt du unsere API über ein Dedicated Deployment? Ersetze einfach
api.langdock.com mit der Basis-URL deines Deployments: <deployment-url>/api/publicErforderliche Scopes
Dieser Endpoint erfordert denSKILL_API Scope.
Erfordert Editor-Zugriff auf den Skill.
Pfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
skillId | string | Ja | UUID des zu aktualisierenden Skills. |
Request Body
| Parameter | Typ | Beschreibung |
|---|---|---|
name | string | Skill-Name. Maximum: 64 Zeichen. |
slug | string | Stabiler Skill-Slug. Nur Kleinbuchstaben, Zahlen und Bindestriche. Maximum: 100 Zeichen. |
description | string | Beschreibung, wann der Skill angewendet werden soll. Maximum: 1024 Zeichen. |
instructions | string | Skill-Anweisungen. Maximum: 50000 Zeichen. |
integrationIds | string[] | Integration-UUIDs, die an den Skill angehängt werden. Ersetzt die aktuelle Integrationsliste. Jede Integration muss in deinem Workspace aktiviert sein. |
Beispiel
const axios = require("axios");
async function updateSkill(skillId) {
const response = await axios.patch(
`https://api.langdock.com/skills/v1/${skillId}`,
{
description: "Applies the support team's latest tone and escalation rules.",
instructions: "Write concise replies, include the next best action, and escalate billing or security issues to the account owner."
},
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
}
);
console.log("Updated Skill:", response.data.skill.updatedAt);
}
updateSkill("550e8400-e29b-41d4-a716-446655440000");
Antwortformat
Erfolgsantwort (200 OK)
{
skill: {
id: string;
name: string;
slug: string;
description: string;
instructions: string;
integrationIds: string[];
createdAt: string;
updatedAt: string;
};
}
Fehlerbehandlung
| Statuscode | Beschreibung |
|---|---|
| 400 | Ungültiger Request Body, fehlende Update-Felder oder nicht zugängliche integrationIds |
| 401 | Ungültiger oder fehlender API Key |
| 403 | Fehlender SKILL_API Scope, kein Skills-Produktzugriff oder kein Editor-Zugriff |
| 404 | Skill nicht gefunden |
| 409 | Skill-Slug-Konflikt |
| 429 | Rate Limit überschritten |
| 500 | Interner Serverfehler |
Langdock blockiert bewusst Browser-basierte Anfragen, um deinen API-Schlüssel zu schützen und die Sicherheit deiner Anwendungen zu gewährleisten. Weitere Informationen findest du in unserem Guide zu Best Practices für API-Schlüssel.
Autorisierungen
API key as Bearer token. Format "Bearer YOUR_API_KEY"
Pfadparameter
UUID of the Skill.
Body
application/json
Skill name.
Required string length:
1 - 64Stable Skill slug.
Maximum string length:
100Pattern:
^[a-z0-9-]+$Description used to explain when the Skill should apply.
Maximum string length:
1024Skill instructions.
Required string length:
1 - 50000Integration IDs to attach to the Skill. Replaces the current integration list.
Antwort
Skill updated successfully
Show child attributes
Show child attributes
War diese Seite hilfreich?
⌘I