Edit, pause or resume a schedule
curl --request PATCH \
--url https://api.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId} \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"name": "Weekly EU roundup",
"cron": "0 6 * * *",
"llmProviders": [
"claude-haiku-latest",
"scp-ml-chatgpt"
],
"executionCount": 3
}
'import requests
url = "https://api.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}"
payload = {
"name": "Weekly EU roundup",
"cron": "0 6 * * *",
"llmProviders": ["claude-haiku-latest", "scp-ml-chatgpt"],
"executionCount": 3
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Weekly EU roundup',
cron: '0 6 * * *',
llmProviders: ['claude-haiku-latest', 'scp-ml-chatgpt'],
executionCount: 3
})
};
fetch('https://api.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}', 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.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}",
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' => 'Weekly EU roundup',
'cron' => '0 6 * * *',
'llmProviders' => [
'claude-haiku-latest',
'scp-ml-chatgpt'
],
'executionCount' => 3
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-project-id: <x-project-id>"
],
]);
$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.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}"
payload := strings.NewReader("{\n \"name\": \"Weekly EU roundup\",\n \"cron\": \"0 6 * * *\",\n \"llmProviders\": [\n \"claude-haiku-latest\",\n \"scp-ml-chatgpt\"\n ],\n \"executionCount\": 3\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-project-id", "<x-project-id>")
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.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Weekly EU roundup\",\n \"cron\": \"0 6 * * *\",\n \"llmProviders\": [\n \"claude-haiku-latest\",\n \"scp-ml-chatgpt\"\n ],\n \"executionCount\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Weekly EU roundup\",\n \"cron\": \"0 6 * * *\",\n \"llmProviders\": [\n \"claude-haiku-latest\",\n \"scp-ml-chatgpt\"\n ],\n \"executionCount\": 3\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"cron": "<string>",
"status": "active",
"llmProviders": [
"<string>"
],
"executionCount": 123,
"queriesCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"nextRunAt": "2023-11-07T05:31:56Z"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Recurrence settings
Edit, pause or resume a schedule
Activating a schedule, or changing the models of an active one, checks that its queries can run on those models.
PATCH
/
api
/
v2
/
projects
/
{projectId}
/
recurrence-settings
/
{recurrenceSettingId}
Edit, pause or resume a schedule
curl --request PATCH \
--url https://api.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId} \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"name": "Weekly EU roundup",
"cron": "0 6 * * *",
"llmProviders": [
"claude-haiku-latest",
"scp-ml-chatgpt"
],
"executionCount": 3
}
'import requests
url = "https://api.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}"
payload = {
"name": "Weekly EU roundup",
"cron": "0 6 * * *",
"llmProviders": ["claude-haiku-latest", "scp-ml-chatgpt"],
"executionCount": 3
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Weekly EU roundup',
cron: '0 6 * * *',
llmProviders: ['claude-haiku-latest', 'scp-ml-chatgpt'],
executionCount: 3
})
};
fetch('https://api.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}', 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.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}",
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' => 'Weekly EU roundup',
'cron' => '0 6 * * *',
'llmProviders' => [
'claude-haiku-latest',
'scp-ml-chatgpt'
],
'executionCount' => 3
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-project-id: <x-project-id>"
],
]);
$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.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}"
payload := strings.NewReader("{\n \"name\": \"Weekly EU roundup\",\n \"cron\": \"0 6 * * *\",\n \"llmProviders\": [\n \"claude-haiku-latest\",\n \"scp-ml-chatgpt\"\n ],\n \"executionCount\": 3\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-project-id", "<x-project-id>")
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.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Weekly EU roundup\",\n \"cron\": \"0 6 * * *\",\n \"llmProviders\": [\n \"claude-haiku-latest\",\n \"scp-ml-chatgpt\"\n ],\n \"executionCount\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/v2/projects/{projectId}/recurrence-settings/{recurrenceSettingId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Weekly EU roundup\",\n \"cron\": \"0 6 * * *\",\n \"llmProviders\": [\n \"claude-haiku-latest\",\n \"scp-ml-chatgpt\"\n ],\n \"executionCount\": 3\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"cron": "<string>",
"status": "active",
"llmProviders": [
"<string>"
],
"executionCount": 123,
"queriesCount": 123,
"createdAt": "2023-11-07T05:31:56Z",
"nextRunAt": "2023-11-07T05:31:56Z"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Headers
Project ID to specify the project context
Body
application/json
Unique within the project
Maximum string length:
100Example:
"Weekly EU roundup"
UTC hour-granular cron, or "every:Nh@HH:00[/YYYY-MM-DD]"
Example:
"0 6 * * *"
Active fires on schedule, paused does not
Available options:
active, paused Raw model names
Example:
["claude-haiku-latest", "scp-ml-chatgpt"]
Runs per query per fire
Required range:
1 <= x <= 100Example:
3
Response
Identifies the schedule in the pause and resume route
Label the project gave the schedule, unique within it
UTC cron
Active fires on the cron, paused never fires and reports no next run
Available options:
active, paused Raw model names
Runs per query per fire
Queries attached to the schedule, each run on every fire
When the schedule was created, not when it last fired
Next fire time; absent when paused or none within 32 days