curl --request POST \
--url https://api.recoupable.dev/api/tasks \
--header 'Content-Type: application/json' \
--data '
{
"title": "Weekly Genre Pulse Check",
"prompt": "Execute this weekly genre analysis workflow and email a summary to the team.",
"schedule": "0 9 * * 4",
"artist_account_id": "1873859c-dd37-4e9a-9bac-80d35a1b2c3d",
"timezone": "America/New_York",
"account_id": "848cd58d-700f-4b38-ab4c-d9f52a1b2c3d"
}
'import requests
url = "https://api.recoupable.dev/api/tasks"
payload = {
"title": "Weekly Genre Pulse Check",
"prompt": "Execute this weekly genre analysis workflow and email a summary to the team.",
"schedule": "0 9 * * 4",
"artist_account_id": "1873859c-dd37-4e9a-9bac-80d35a1b2c3d",
"timezone": "America/New_York",
"account_id": "848cd58d-700f-4b38-ab4c-d9f52a1b2c3d"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Weekly Genre Pulse Check',
prompt: 'Execute this weekly genre analysis workflow and email a summary to the team.',
schedule: '0 9 * * 4',
artist_account_id: '1873859c-dd37-4e9a-9bac-80d35a1b2c3d',
timezone: 'America/New_York',
account_id: '848cd58d-700f-4b38-ab4c-d9f52a1b2c3d'
})
};
fetch('https://api.recoupable.dev/api/tasks', 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.recoupable.dev/api/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Weekly Genre Pulse Check',
'prompt' => 'Execute this weekly genre analysis workflow and email a summary to the team.',
'schedule' => '0 9 * * 4',
'artist_account_id' => '1873859c-dd37-4e9a-9bac-80d35a1b2c3d',
'timezone' => 'America/New_York',
'account_id' => '848cd58d-700f-4b38-ab4c-d9f52a1b2c3d'
]),
CURLOPT_HTTPHEADER => [
"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.recoupable.dev/api/tasks"
payload := strings.NewReader("{\n \"title\": \"Weekly Genre Pulse Check\",\n \"prompt\": \"Execute this weekly genre analysis workflow and email a summary to the team.\",\n \"schedule\": \"0 9 * * 4\",\n \"artist_account_id\": \"1873859c-dd37-4e9a-9bac-80d35a1b2c3d\",\n \"timezone\": \"America/New_York\",\n \"account_id\": \"848cd58d-700f-4b38-ab4c-d9f52a1b2c3d\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.recoupable.dev/api/tasks")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Weekly Genre Pulse Check\",\n \"prompt\": \"Execute this weekly genre analysis workflow and email a summary to the team.\",\n \"schedule\": \"0 9 * * 4\",\n \"artist_account_id\": \"1873859c-dd37-4e9a-9bac-80d35a1b2c3d\",\n \"timezone\": \"America/New_York\",\n \"account_id\": \"848cd58d-700f-4b38-ab4c-d9f52a1b2c3d\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Weekly Genre Pulse Check\",\n \"prompt\": \"Execute this weekly genre analysis workflow and email a summary to the team.\",\n \"schedule\": \"0 9 * * 4\",\n \"artist_account_id\": \"1873859c-dd37-4e9a-9bac-80d35a1b2c3d\",\n \"timezone\": \"America/New_York\",\n \"account_id\": \"848cd58d-700f-4b38-ab4c-d9f52a1b2c3d\"\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"prompt": "<string>",
"schedule": "<string>",
"timezone": "America/New_York",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"artist_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true,
"trigger_schedule_id": "<string>",
"recent_runs": [
{
"id": "<string>",
"taskIdentifier": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"idempotencyKey": "<string>",
"version": "<string>",
"isTest": true,
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"delayedUntil": "2023-11-07T05:31:56Z",
"ttl": "<unknown>",
"expiredAt": "2023-11-07T05:31:56Z",
"tags": [
"<string>"
],
"metadata": {},
"costInCents": 123,
"baseCostInCents": 123,
"durationMs": 123,
"env": {
"id": "<string>",
"name": "<string>",
"user": "<string>"
},
"depth": 123,
"batchId": "<string>",
"payload": "<unknown>",
"output": {
"videoSourceUrl": "<string>",
"imageUrl": "<string>",
"captionText": "<string>",
"template": "artist-caption-bedroom",
"lipsync": true,
"audio": {
"songTitle": "<string>",
"songFilename": "<string>",
"startSeconds": 123,
"durationSeconds": 123,
"clipLyrics": "<string>",
"clipMood": "<string>"
}
},
"error": {
"message": "<string>",
"name": "<string>",
"stackTrace": "<string>"
},
"attempts": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"error": {
"message": "<string>",
"name": "<string>",
"stackTrace": "<string>"
}
}
],
"schedule": {},
"relatedRuns": {}
}
],
"upcoming": [
"2023-11-07T05:31:56Z"
],
"owner_email": "<string>",
"model": "<string>"
}
],
"error": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Create Task
Create a new scheduled task that runs a prompt against an artist on a recurring cron schedule. The response matches the GET endpoint (a TasksResponse with the created task in the tasks array).
curl --request POST \
--url https://api.recoupable.dev/api/tasks \
--header 'Content-Type: application/json' \
--data '
{
"title": "Weekly Genre Pulse Check",
"prompt": "Execute this weekly genre analysis workflow and email a summary to the team.",
"schedule": "0 9 * * 4",
"artist_account_id": "1873859c-dd37-4e9a-9bac-80d35a1b2c3d",
"timezone": "America/New_York",
"account_id": "848cd58d-700f-4b38-ab4c-d9f52a1b2c3d"
}
'import requests
url = "https://api.recoupable.dev/api/tasks"
payload = {
"title": "Weekly Genre Pulse Check",
"prompt": "Execute this weekly genre analysis workflow and email a summary to the team.",
"schedule": "0 9 * * 4",
"artist_account_id": "1873859c-dd37-4e9a-9bac-80d35a1b2c3d",
"timezone": "America/New_York",
"account_id": "848cd58d-700f-4b38-ab4c-d9f52a1b2c3d"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Weekly Genre Pulse Check',
prompt: 'Execute this weekly genre analysis workflow and email a summary to the team.',
schedule: '0 9 * * 4',
artist_account_id: '1873859c-dd37-4e9a-9bac-80d35a1b2c3d',
timezone: 'America/New_York',
account_id: '848cd58d-700f-4b38-ab4c-d9f52a1b2c3d'
})
};
fetch('https://api.recoupable.dev/api/tasks', 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.recoupable.dev/api/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'Weekly Genre Pulse Check',
'prompt' => 'Execute this weekly genre analysis workflow and email a summary to the team.',
'schedule' => '0 9 * * 4',
'artist_account_id' => '1873859c-dd37-4e9a-9bac-80d35a1b2c3d',
'timezone' => 'America/New_York',
'account_id' => '848cd58d-700f-4b38-ab4c-d9f52a1b2c3d'
]),
CURLOPT_HTTPHEADER => [
"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.recoupable.dev/api/tasks"
payload := strings.NewReader("{\n \"title\": \"Weekly Genre Pulse Check\",\n \"prompt\": \"Execute this weekly genre analysis workflow and email a summary to the team.\",\n \"schedule\": \"0 9 * * 4\",\n \"artist_account_id\": \"1873859c-dd37-4e9a-9bac-80d35a1b2c3d\",\n \"timezone\": \"America/New_York\",\n \"account_id\": \"848cd58d-700f-4b38-ab4c-d9f52a1b2c3d\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.recoupable.dev/api/tasks")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Weekly Genre Pulse Check\",\n \"prompt\": \"Execute this weekly genre analysis workflow and email a summary to the team.\",\n \"schedule\": \"0 9 * * 4\",\n \"artist_account_id\": \"1873859c-dd37-4e9a-9bac-80d35a1b2c3d\",\n \"timezone\": \"America/New_York\",\n \"account_id\": \"848cd58d-700f-4b38-ab4c-d9f52a1b2c3d\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Weekly Genre Pulse Check\",\n \"prompt\": \"Execute this weekly genre analysis workflow and email a summary to the team.\",\n \"schedule\": \"0 9 * * 4\",\n \"artist_account_id\": \"1873859c-dd37-4e9a-9bac-80d35a1b2c3d\",\n \"timezone\": \"America/New_York\",\n \"account_id\": \"848cd58d-700f-4b38-ab4c-d9f52a1b2c3d\"\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"prompt": "<string>",
"schedule": "<string>",
"timezone": "America/New_York",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"artist_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true,
"trigger_schedule_id": "<string>",
"recent_runs": [
{
"id": "<string>",
"taskIdentifier": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"idempotencyKey": "<string>",
"version": "<string>",
"isTest": true,
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"delayedUntil": "2023-11-07T05:31:56Z",
"ttl": "<unknown>",
"expiredAt": "2023-11-07T05:31:56Z",
"tags": [
"<string>"
],
"metadata": {},
"costInCents": 123,
"baseCostInCents": 123,
"durationMs": 123,
"env": {
"id": "<string>",
"name": "<string>",
"user": "<string>"
},
"depth": 123,
"batchId": "<string>",
"payload": "<unknown>",
"output": {
"videoSourceUrl": "<string>",
"imageUrl": "<string>",
"captionText": "<string>",
"template": "artist-caption-bedroom",
"lipsync": true,
"audio": {
"songTitle": "<string>",
"songFilename": "<string>",
"startSeconds": 123,
"durationSeconds": 123,
"clipLyrics": "<string>",
"clipMood": "<string>"
}
},
"error": {
"message": "<string>",
"name": "<string>",
"stackTrace": "<string>"
},
"attempts": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"error": {
"message": "<string>",
"name": "<string>",
"stackTrace": "<string>"
}
}
],
"schedule": {},
"relatedRuns": {}
}
],
"upcoming": [
"2023-11-07T05:31:56Z"
],
"owner_email": "<string>",
"model": "<string>"
}
],
"error": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Body
Task to create
Descriptive title of the task
"Weekly Genre Pulse Check"
Instruction/prompt executed by the task
"Execute this weekly genre analysis workflow and email a summary to the team."
Cron expression defining when the task runs (e.g., '0 9 * * 4' for Thursdays at 9 AM)
"0 9 * * 4"
UUID of the associated artist account
"1873859c-dd37-4e9a-9bac-80d35a1b2c3d"
Optional IANA time zone (e.g. America/New_York) the cron schedule is interpreted in, DST-aware. Defaults to UTC. Applied to the Trigger.dev schedule (the source of truth); not stored separately.
"America/New_York"
UUID of the account to create the task for. Only applicable when the authenticated account has access to multiple accounts via organization membership. If not provided, the task is created for the API key's own account.
"848cd58d-700f-4b38-ab4c-d9f52a1b2c3d"
Was this page helpful?
