Nutzt du unsere API über ein Dedicated Deployment? Ersetze einfach api.langdock.com mit der Basis-URL deines Deployments: <deployment-url>/api/public
Aktualisiert eine bestehende Action in einer Integration. Dabei wird die Action-Konfiguration mit den angegebenen Werten ersetzt.
Erforderliche Scopes
Dieser Endpoint erfordert den INTEGRATION_API Scope.
Pfad-Parameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|
integrationId | string | Ja | UUID der Integration |
actionId | string | Ja | UUID der zu aktualisierenden Action |
Request Body
| Parameter | Typ | Erforderlich | Beschreibung |
|---|
name | string | Ja | Action-Name (max. 100 Zeichen) |
description | string | Nein | Action-Beschreibung (max. 1.000 Zeichen) |
code | string | Nein | Auszuführender JavaScript-Code |
inputFields | array | Nein | Eingabefelder für die Action |
Das vollständige Eingabefeld-Schema findest du unter Action erstellen.
Beispiel
const axios = require("axios");
async function updateAction(integrationId, actionId) {
const response = await axios.put(
`https://api.langdock.com/integrations/v1/${integrationId}/actions/${actionId}`,
{
name: "Get User Data v2",
description: "Updated action with additional fields",
code: `
const response = await fetch('https://api.example.com/v2/users/' + inputs.userId);
return await response.json();
`,
inputFields: [
{
label: "User ID",
type: "TEXT",
required: true
},
{
label: "Format",
type: "SELECT",
options: [
{ label: "JSON", value: "json" },
{ label: "XML", value: "xml" }
],
required: false
}
]
},
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
}
);
console.log("Updated action:", response.data.action);
}
updateAction("550e8400-e29b-41d4-a716-446655440000", "660e8400-e29b-41d4-a716-446655440001");
Erfolgreiche Antwort (200 OK)
{
action: {
id: string;
name: string;
slug: string;
description: string;
code: string | null;
order: number;
inputFields: Array<{
slug: string;
label: string;
type: string;
description: string;
placeholder: string | null;
required: boolean;
order: number;
options: Array<{label: string, value: string}> | null;
allowMultiSelect: boolean | null;
contextActionId: string | null;
}>;
};
}
Fehlerbehandlung
| Status Code | Beschreibung |
|---|
| 400 | Ungültiger Request Body oder ungültige IDs |
| 401 | Ungültiger oder fehlender API-Schlüssel |
| 403 | Kein Zugriff auf diese Integration |
| 404 | Integration oder Action nicht gefunden |
| 409 | Eine Action mit diesem Namen existiert bereits |
| 429 | Rate Limit überschritten |
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.