Pause a scheduled task
curl --request POST \
--url https://api.langdock.com/automations/v1/{automationId}/pause \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/automations/v1/{automationId}/pause"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.langdock.com/automations/v1/{automationId}/pause', 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/automations/v1/{automationId}/pause",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.langdock.com/automations/v1/{automationId}/pause"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.langdock.com/automations/v1/{automationId}/pause")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/automations/v1/{automationId}/pause")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyScheduled Tasks API
Scheduled Task pausieren
Pausiere eine Scheduled Task, die diesem Workspace-API-Key gehört
POST
/
automations
/
v1
/
{automationId}
/
pause
Pause a scheduled task
curl --request POST \
--url https://api.langdock.com/automations/v1/{automationId}/pause \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/automations/v1/{automationId}/pause"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.langdock.com/automations/v1/{automationId}/pause', 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/automations/v1/{automationId}/pause",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.langdock.com/automations/v1/{automationId}/pause"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.langdock.com/automations/v1/{automationId}/pause")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/automations/v1/{automationId}/pause")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodySetzt
Dieser Endpoint hat keinen Body.
active auf false bei einer Scheduled Task, die diesem Workspace-API-Key gehört. Eine pausierte Aufgabe läuft nicht nach ihrer Uhrzeit. Die Antwort enthält kein runCount.
Basis-URL
https://api.langdock.com/automations/v1/{automationId}/pause
Dedicated DeploymentsErsetze
api.langdock.com durch <your-deployment-url>/api/public in allen Anfragen.Benötigte Scopes
Dieser Endpoint braucht den ScopeAUTOMATION_API (Scheduled Tasks API) auf einem Workspace-API-Key.
Parameter
| Parameter | In | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
automationId | Pfad | string | Ja | UUID der Scheduled Task. |
Beispiel
const axios = require("axios");
async function pauseScheduledTask(automationId) {
const response = await axios.post(
`https://api.langdock.com/automations/v1/${automationId}/pause`,
null,
{
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
}
);
console.log(response.data.automation.active);
}
pauseScheduledTask("550e8400-e29b-41d4-a716-446655440000");
Antwortformat
Erfolgreiche Antwort (200 OK)
automation entspricht dem Scheduled-Task-Objekt ohne runCount. active ist false.
Fehlerbehandlung
| Statuscode | Beschreibung |
|---|---|
| 400 | Ungültige Task-ID |
| 401 | Ungültiger oder fehlender API-Key, oder der Key-User wurde nicht gefunden |
| 403 | AUTOMATION_API fehlt, persönlicher API-Key, Scheduled Tasks deaktiviert, oder der Key hat keinen Zugriff |
| 404 | Message AUTOMATION_NOT_FOUND |
| 405 | Methode nicht erlaubt |
| 429 | Rate Limit überschritten |
| 500 | Interner Serverfehler |
Langdock blockiert Anfragen aus Browser-Origins absichtlich, um deinen API-Key zu schützen und deine Anwendungen sicher zu halten. Mehr dazu findest du im Guide zu API Key Best Practices.
War diese Seite hilfreich?