Scheduled jobs

Update

Partial update of a scheduled job's cron schedule, prompt, target channel, or enabled state. Only the fields included in the request body are changed.

Partial update. Send only the fields you want to change. An empty body returns 400 no fields to update.

PATCH /api/public/v1/scheduled-jobs/{job_id}

Request body

Prop

Type

Example

curl -X PATCH https://api.nairi.ai/api/public/v1/scheduled-jobs/JOB_ID \
  -H "Authorization: Bearer $NAIRI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "schedule": "0 10 * * *",
    "is_enabled": false
  }'
const res = await fetch(`https://api.nairi.ai/api/public/v1/scheduled-jobs/${jobId}`, {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.NAIRI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    schedule: "0 10 * * *",
    is_enabled: false,
  }),
});
const data = 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::Patch.new(uri)
req["Authorization"] = "Bearer #{ENV['NAIRI_API_KEY']}"
req["Content-Type"] = "application/json"
req.body = {
  schedule: "0 10 * * *",
  is_enabled: false,
}.to_json

res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)
import os
import requests

res = requests.patch(
    f"https://api.nairi.ai/api/public/v1/scheduled-jobs/{job_id}",
    headers={
        "Authorization": f"Bearer {os.environ['NAIRI_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "schedule": "0 10 * * *",
        "is_enabled": False,
    },
)
data = res.json()
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	jobID := os.Getenv("JOB_ID")
	body, _ := json.Marshal(map[string]any{
		"schedule":   "0 10 * * *",
		"is_enabled": false,
	})
	req, _ := http.NewRequest("PATCH", "https://api.nairi.ai/api/public/v1/scheduled-jobs/"+jobID, bytes.NewReader(body))
	req.Header.Set("Authorization", "Bearer "+os.Getenv("NAIRI_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	raw, _ := io.ReadAll(res.Body)
	var data map[string]any
	json.Unmarshal(raw, &data)
	fmt.Println(data)
}

Response

{
  "id": "sj_01K7XSRBBM0294N1WBD2M9EVQC",
  "schedule": "0 10 * * *",
  "timezone": "America/New_York",
  "prompt": "Generate daily status report",
  "connected_channel_id": "C09M8FRJYTF",
  "job_type": "slack",
  "is_threaded": true,
  "is_enabled": false,
  "last_executed_at": "2026-04-12T14:00:00.000Z",
  "created_at": "2026-04-12T18:45:12.000Z",
  "updated_at": "2026-04-12T19:00:00.000Z"
}

On this page