Update a prompt folder
curl --request PATCH \
--url https://api.langdock.com/prompts/v1/folders/{folderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"sharedWithWorkspace": true,
"sharedWithGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.langdock.com/prompts/v1/folders/{folderId}"
payload = {
"name": "<string>",
"sharedWithWorkspace": True,
"sharedWithGroupId": "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>',
sharedWithWorkspace: true,
sharedWithGroupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.langdock.com/prompts/v1/folders/{folderId}', 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/prompts/v1/folders/{folderId}",
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>',
'sharedWithWorkspace' => true,
'sharedWithGroupId' => '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/prompts/v1/folders/{folderId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sharedWithWorkspace\": true,\n \"sharedWithGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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/prompts/v1/folders/{folderId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sharedWithWorkspace\": true,\n \"sharedWithGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/prompts/v1/folders/{folderId}")
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 \"sharedWithWorkspace\": true,\n \"sharedWithGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"folder": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sharedWithWorkspace": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"sharedWithGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Prompt Library API
Prompt-Ordner aktualisieren
Aktualisiere einen bestehenden Prompt-Ordner
PATCH
/
prompts
/
v1
/
folders
/
{folderId}
Update a prompt folder
curl --request PATCH \
--url https://api.langdock.com/prompts/v1/folders/{folderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"sharedWithWorkspace": true,
"sharedWithGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.langdock.com/prompts/v1/folders/{folderId}"
payload = {
"name": "<string>",
"sharedWithWorkspace": True,
"sharedWithGroupId": "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>',
sharedWithWorkspace: true,
sharedWithGroupId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.langdock.com/prompts/v1/folders/{folderId}', 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/prompts/v1/folders/{folderId}",
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>',
'sharedWithWorkspace' => true,
'sharedWithGroupId' => '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/prompts/v1/folders/{folderId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sharedWithWorkspace\": true,\n \"sharedWithGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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/prompts/v1/folders/{folderId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sharedWithWorkspace\": true,\n \"sharedWithGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/prompts/v1/folders/{folderId}")
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 \"sharedWithWorkspace\": true,\n \"sharedWithGroupId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"folder": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sharedWithWorkspace": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"sharedWithGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Aktualisiert einen bestehenden Prompt-Ordner in deinem Workspace. Gib nur die Felder an, die du ändern möchtest.
Basis-URL
https://api.langdock.com/prompts/v1/folders/{folderId}
Dedicated DeploymentsErsetze
api.langdock.com durch <your-deployment-url>/api/public in allen Anfragen.Erforderliche Scopes
Dieser Endpoint erfordert denPROMPT_API Scope.
Private Ordner erfordern Zugriff als Ersteller. Workspace-geteilte Ordner erfordern Workspace-Editor-Zugriff oder
sharePrompts. Gruppen-geteilte Ordner erfordern Gruppen-Editor-Zugriff oder Workspace-Editor-Zugriff.Parameter
Pfad-Parameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
folderId | string | Ja | UUID des zu aktualisierenden Ordners. |
Request Body
| Parameter | Typ | Beschreibung |
|---|---|---|
name | string | Ordnername. Minimum: 2 Zeichen. Maximum: 50 Zeichen. |
sharedWithWorkspace | boolean | Teilt den Ordner mit dem Workspace. Darf nicht true sein, solange der Ordner mit einer Gruppe geteilt ist. |
sharedWithGroupId | string | null | Gruppen-UUID zum Teilen oder null, um die Gruppe zu trennen. Darf nicht gesetzt sein, solange der Ordner mit dem Workspace geteilt ist. |
Beispiel
const axios = require("axios");
async function updatePromptFolder(folderId) {
const response = await axios.patch(
`https://api.langdock.com/prompts/v1/folders/${folderId}`,
{
name: "Support templates"
},
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
}
);
console.log("Updated folder:", response.data.folder.updatedAt);
}
updatePromptFolder("7c9e6679-7425-40de-944b-e07fc1f90ae7");
Antwortformat
Erfolgsantwort (200 OK)
{
folder: {
id: string;
name: string;
createdBy: string;
sharedWithWorkspace: boolean;
sharedWithGroupId: string | null;
createdAt: string;
updatedAt: string;
};
}
Fehlerbehandlung
| Statuscode | Beschreibung |
|---|---|
| 400 | Ungültiger Request Body, fehlende Update-Felder oder Workspace-Freigabe kombiniert mit Gruppen-Freigabe |
| 401 | Ungültiger oder fehlender API Key |
| 403 | Fehlender PROMPT_API Scope oder kein Verwaltungszugriff |
| 404 | Prompt-Ordner oder Gruppe nicht gefunden |
| 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 prompt folder.
Body
application/json
Antwort
Prompt folder updated successfully
Show child attributes
Show child attributes
War diese Seite hilfreich?
⌘I