Get
Fetch a single scheduled job by ID from your Nairi organization. Returns the cron schedule, prompt, target channel, enabled state, and next run time.
GET /api/public/v1/scheduled-jobs/{job_id}Example
curl -X GET https://api.nairi.ai/api/public/v1/scheduled-jobs/JOB_ID \
-H "Authorization: Bearer $NAIRI_API_KEY"const res = await fetch(`https://api.nairi.ai/api/public/v1/scheduled-jobs/${jobId}`, {
headers: {
Authorization: `Bearer ${process.env.NAIRI_API_KEY}`,
},
});
const job = await res.json();require "net/http"
require "json"
require "uri"
uri = URI("https://api.nairi.ai/api/public/v1/scheduled-jobs/#{job_id}")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV['NAIRI_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
job = JSON.parse(res.body)import os
import requests
res = requests.get(
f"https://api.nairi.ai/api/public/v1/scheduled-jobs/{job_id}",
headers={"Authorization": f"Bearer {os.environ['NAIRI_API_KEY']}"},
)
job = res.json()package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
func main() {
jobID := os.Getenv("JOB_ID")
req, _ := http.NewRequest("GET", "https://api.nairi.ai/api/public/v1/scheduled-jobs/"+jobID, nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("NAIRI_API_KEY"))
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
raw, _ := io.ReadAll(res.Body)
var job map[string]any
json.Unmarshal(raw, &job)
fmt.Println(job)
}Response
{
"id": "sj_01K7XSRBBM0294N1WBD2M9EVQC",
"schedule": "0 9 * * *",
"timezone": "America/New_York",
"prompt": "Generate daily status report",
"connected_channel_id": "C09M8FRJYTF",
"job_type": "slack",
"is_threaded": true,
"is_enabled": true,
"last_executed_at": "2026-04-12T14:00:00.000Z",
"next_run_at": "2026-04-13T13:00:00.000Z",
"last_run": {
"job_id": "job_01KRK1V46BXS73CSNK2VR35NPJ",
"status": "completed",
"started_at": "2026-04-12T13:00:00.000Z"
},
"created_at": "2026-04-12T18:45:12.000Z",
"updated_at": "2026-04-12T18:45:12.000Z"
}next_run_at is the next tick the schedule will fire at, in UTC. It is absent while is_enabled is false.
A one-time job has run_at (UTC) and an empty schedule; run_at is absent on recurring jobs. Its next_run_at equals run_at until it fires, after which the job is paused. If it could not run within an hour of run_at, it expires instead: it is paused without running and last_executed_at stays before run_at.
last_run is the most recent job this schedule created, with the same status words as Runs. It is absent when the job has never run. If the lookup behind it fails, last_run is absent and last_run_unavailable is true, so you can tell "never ran" from "could not check".
Create
Create a scheduled job that runs an agent prompt on a cron schedule, or once at a set time, and posts results to a Slack or Discord channel. Returns the created job ID.
Update
Partial update of a scheduled job's cron schedule or one-time run_at, prompt, target channel, or enabled state. Only the fields included in the request body are changed.