Get a scheduled task
curl --request GET \
--url https://api.langdock.com/automations/v1/{automationId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/automations/v1/{automationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.langdock.com/automations/v1/{automationId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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}"
req, _ := http.NewRequest("GET", 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.get("https://api.langdock.com/automations/v1/{automationId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/automations/v1/{automationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyScheduled Tasks API
Get Scheduled Task
Get one scheduled task owned by the workspace API key, including its run count
GET
/
automations
/
v1
/
{automationId}
Get a scheduled task
curl --request GET \
--url https://api.langdock.com/automations/v1/{automationId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/automations/v1/{automationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.langdock.com/automations/v1/{automationId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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}"
req, _ := http.NewRequest("GET", 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.get("https://api.langdock.com/automations/v1/{automationId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/automations/v1/{automationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyReturns one scheduled task owned by this workspace API key, including
runCount. A missing, deleted, or other owner’s task returns 404 with AUTOMATION_NOT_FOUND.
Base URL
https://api.langdock.com/automations/v1/{automationId}
Dedicated deploymentsReplace
api.langdock.com with <your-deployment-url>/api/public in all requests.Required scopes
This endpoint requires theAUTOMATION_API scope (Scheduled Tasks API) on a workspace API key.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
automationId | Path | string | Yes | UUID of the scheduled task. |
Example
const axios = require("axios");
async function getScheduledTask(automationId) {
const response = await axios.get(
`https://api.langdock.com/automations/v1/${automationId}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
}
);
console.log(response.data.automation.runCount);
}
getScheduledTask("550e8400-e29b-41d4-a716-446655440000");
Response format
Success response (200 OK)
automation matches the scheduled task object, including runCount.
{
automation: {
id: string;
createdAt: string;
name: string;
prompt: string;
modelId: string | null;
modelMode: "UNSET" | "EXPLICIT" | "AUTO";
assistantId: string | null;
taggedAssistantId: string | null;
frequency:
| "MANUAL"
| "DAILY"
| "WEEKDAYS"
| "WEEKLY"
| "MONTHLY"
| "SELECTED_WEEKDAYS";
timeOfDay: string | null;
dayOfWeek: number | null;
dayOfMonth: number | null;
daysOfWeek: number[];
timezone: string | null;
active: boolean;
lastRunAt: string | null;
runCount: number;
attachments: Array<{
id: string;
name: string;
mimeType: string | null;
type: string | null;
}>;
taggedIntegrationIds: string[];
taggedKnowledgeFolderIds: string[];
taggedWorkflowIds: string[];
taggedSkillSlugs: string[];
};
}
Error handling
| Status code | Description |
|---|---|
| 400 | Invalid task id |
| 401 | Invalid or missing API key, or the key user was not found |
| 403 | Missing AUTOMATION_API, a personal API key, Scheduled Tasks disabled, or the key has no access |
| 404 | AUTOMATION_NOT_FOUND |
| 405 | Method not allowed |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.
Was this page helpful?