curl --request POST \
--url https://api.instacloud.com/projects/{projectId}/cron-jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"expression": "<string>",
"target": {
"kind": "external",
"url": "<string>"
},
"branch": "<string>",
"request": {
"headers": {},
"body": "<string>",
"secretRefs": {}
},
"requestTimeoutMs": 150500,
"retry": {
"platformMaxRetries": 5,
"applicationMaxRetries": 5,
"retryableStatuses": [
349
],
"maxRunAgeMs": 1
}
}
'import requests
url = "https://api.instacloud.com/projects/{projectId}/cron-jobs"
payload = {
"name": "<string>",
"expression": "<string>",
"target": {
"kind": "external",
"url": "<string>"
},
"branch": "<string>",
"request": {
"headers": {},
"body": "<string>",
"secretRefs": {}
},
"requestTimeoutMs": 150500,
"retry": {
"platformMaxRetries": 5,
"applicationMaxRetries": 5,
"retryableStatuses": [349],
"maxRunAgeMs": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
expression: '<string>',
target: {kind: 'external', url: '<string>'},
branch: '<string>',
request: {headers: {}, body: JSON.stringify('<string>'), secretRefs: {}},
requestTimeoutMs: 150500,
retry: {
platformMaxRetries: 5,
applicationMaxRetries: 5,
retryableStatuses: [349],
maxRunAgeMs: 1
}
})
};
fetch('https://api.instacloud.com/projects/{projectId}/cron-jobs', 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.instacloud.com/projects/{projectId}/cron-jobs",
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([
'name' => '<string>',
'expression' => '<string>',
'target' => [
'kind' => 'external',
'url' => '<string>'
],
'branch' => '<string>',
'request' => [
'headers' => [
],
'body' => '<string>',
'secretRefs' => [
]
],
'requestTimeoutMs' => 150500,
'retry' => [
'platformMaxRetries' => 5,
'applicationMaxRetries' => 5,
'retryableStatuses' => [
349
],
'maxRunAgeMs' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.instacloud.com/projects/{projectId}/cron-jobs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expression\": \"<string>\",\n \"target\": {\n \"kind\": \"external\",\n \"url\": \"<string>\"\n },\n \"branch\": \"<string>\",\n \"request\": {\n \"headers\": {},\n \"body\": \"<string>\",\n \"secretRefs\": {}\n },\n \"requestTimeoutMs\": 150500,\n \"retry\": {\n \"platformMaxRetries\": 5,\n \"applicationMaxRetries\": 5,\n \"retryableStatuses\": [\n 349\n ],\n \"maxRunAgeMs\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.instacloud.com/projects/{projectId}/cron-jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expression\": \"<string>\",\n \"target\": {\n \"kind\": \"external\",\n \"url\": \"<string>\"\n },\n \"branch\": \"<string>\",\n \"request\": {\n \"headers\": {},\n \"body\": \"<string>\",\n \"secretRefs\": {}\n },\n \"requestTimeoutMs\": 150500,\n \"retry\": {\n \"platformMaxRetries\": 5,\n \"applicationMaxRetries\": 5,\n \"retryableStatuses\": [\n 349\n ],\n \"maxRunAgeMs\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instacloud.com/projects/{projectId}/cron-jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"expression\": \"<string>\",\n \"target\": {\n \"kind\": \"external\",\n \"url\": \"<string>\"\n },\n \"branch\": \"<string>\",\n \"request\": {\n \"headers\": {},\n \"body\": \"<string>\",\n \"secretRefs\": {}\n },\n \"requestTimeoutMs\": 150500,\n \"retry\": {\n \"platformMaxRetries\": 5,\n \"applicationMaxRetries\": 5,\n \"retryableStatuses\": [\n 349\n ],\n \"maxRunAgeMs\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"job": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"branch": "<string>",
"name": "<string>",
"expression": "<string>",
"timezone": "<string>",
"enabled": true,
"revision": 123,
"next_run_at": "2023-11-07T05:31:56Z",
"target": {
"kind": "external",
"url": "<string>"
},
"request": {
"method": "GET",
"headerNames": [
"<string>"
]
},
"request_timeout_ms": 123,
"retry_policy": {
"platformMaxRetries": 5,
"applicationMaxRetries": 5,
"retryableStatuses": [
349
],
"maxRunAgeMs": 1
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"status": "approval_required",
"approvalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action": "<string>",
"actions": [
"<string>"
],
"message": "<string>",
"url": "<string>",
"nextActions": [
{
"op": "<string>",
"reason": "<string>",
"args": {},
"gated": true
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Create cron job
Token scope: account · org · project — read-only tokens refused (not a GET).
Create a cron job on a branch. Gated — cron.write. 403 also when the org’s schedule quota is full, or the target service belongs to another organization.
curl --request POST \
--url https://api.instacloud.com/projects/{projectId}/cron-jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"expression": "<string>",
"target": {
"kind": "external",
"url": "<string>"
},
"branch": "<string>",
"request": {
"headers": {},
"body": "<string>",
"secretRefs": {}
},
"requestTimeoutMs": 150500,
"retry": {
"platformMaxRetries": 5,
"applicationMaxRetries": 5,
"retryableStatuses": [
349
],
"maxRunAgeMs": 1
}
}
'import requests
url = "https://api.instacloud.com/projects/{projectId}/cron-jobs"
payload = {
"name": "<string>",
"expression": "<string>",
"target": {
"kind": "external",
"url": "<string>"
},
"branch": "<string>",
"request": {
"headers": {},
"body": "<string>",
"secretRefs": {}
},
"requestTimeoutMs": 150500,
"retry": {
"platformMaxRetries": 5,
"applicationMaxRetries": 5,
"retryableStatuses": [349],
"maxRunAgeMs": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
expression: '<string>',
target: {kind: 'external', url: '<string>'},
branch: '<string>',
request: {headers: {}, body: JSON.stringify('<string>'), secretRefs: {}},
requestTimeoutMs: 150500,
retry: {
platformMaxRetries: 5,
applicationMaxRetries: 5,
retryableStatuses: [349],
maxRunAgeMs: 1
}
})
};
fetch('https://api.instacloud.com/projects/{projectId}/cron-jobs', 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.instacloud.com/projects/{projectId}/cron-jobs",
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([
'name' => '<string>',
'expression' => '<string>',
'target' => [
'kind' => 'external',
'url' => '<string>'
],
'branch' => '<string>',
'request' => [
'headers' => [
],
'body' => '<string>',
'secretRefs' => [
]
],
'requestTimeoutMs' => 150500,
'retry' => [
'platformMaxRetries' => 5,
'applicationMaxRetries' => 5,
'retryableStatuses' => [
349
],
'maxRunAgeMs' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.instacloud.com/projects/{projectId}/cron-jobs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expression\": \"<string>\",\n \"target\": {\n \"kind\": \"external\",\n \"url\": \"<string>\"\n },\n \"branch\": \"<string>\",\n \"request\": {\n \"headers\": {},\n \"body\": \"<string>\",\n \"secretRefs\": {}\n },\n \"requestTimeoutMs\": 150500,\n \"retry\": {\n \"platformMaxRetries\": 5,\n \"applicationMaxRetries\": 5,\n \"retryableStatuses\": [\n 349\n ],\n \"maxRunAgeMs\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.instacloud.com/projects/{projectId}/cron-jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expression\": \"<string>\",\n \"target\": {\n \"kind\": \"external\",\n \"url\": \"<string>\"\n },\n \"branch\": \"<string>\",\n \"request\": {\n \"headers\": {},\n \"body\": \"<string>\",\n \"secretRefs\": {}\n },\n \"requestTimeoutMs\": 150500,\n \"retry\": {\n \"platformMaxRetries\": 5,\n \"applicationMaxRetries\": 5,\n \"retryableStatuses\": [\n 349\n ],\n \"maxRunAgeMs\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.instacloud.com/projects/{projectId}/cron-jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"expression\": \"<string>\",\n \"target\": {\n \"kind\": \"external\",\n \"url\": \"<string>\"\n },\n \"branch\": \"<string>\",\n \"request\": {\n \"headers\": {},\n \"body\": \"<string>\",\n \"secretRefs\": {}\n },\n \"requestTimeoutMs\": 150500,\n \"retry\": {\n \"platformMaxRetries\": 5,\n \"applicationMaxRetries\": 5,\n \"retryableStatuses\": [\n 349\n ],\n \"maxRunAgeMs\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"job": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"branch": "<string>",
"name": "<string>",
"expression": "<string>",
"timezone": "<string>",
"enabled": true,
"revision": 123,
"next_run_at": "2023-11-07T05:31:56Z",
"target": {
"kind": "external",
"url": "<string>"
},
"request": {
"method": "GET",
"headerNames": [
"<string>"
]
},
"request_timeout_ms": 123,
"retry_policy": {
"platformMaxRetries": 5,
"applicationMaxRetries": 5,
"retryableStatuses": [
349
],
"maxRunAgeMs": 1
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"status": "approval_required",
"approvalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action": "<string>",
"actions": [
"<string>"
],
"message": "<string>",
"url": "<string>",
"nextActions": [
{
"op": "<string>",
"reason": "<string>",
"args": {},
"gated": true
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Session access JWT or an API token (insta_<prefix>_<secret>).
Path Parameters
Body
unique per branch
1 - 645-field cron expression, always evaluated in UTC
1 - 256Where the job sends its request. An internal target names the SERVICE, never a URL: the worker resolves the live route at send time, so a redeploy or a region move cannot leave a job firing at a dead host.
- Option 1
- Option 2
Show child attributes
Show child attributes
target branch (default: the project’s default branch)
Stored encrypted; its VALUES are never returned. Send the whole object to replace it — reads answer with request (method and header names only).
Show child attributes
Show child attributes
excludes cold start: the wake is timed separately
1000 <= x <= 300000Show child attributes
Show child attributes
Response
Default Response
A cron schedule. Header values are write-only; request describes the stored request without them.
Show child attributes
Show child attributes