# Update

Partial update of a scheduled job's schedule, prompt, channel, or enabled state.





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

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

## Request body [#request-body]

<TypeTable
  type="{
  schedule: { type: &#x22;string&#x22;, description: &#x22;Updated cron expression.&#x22; },
  timezone: { type: &#x22;string&#x22;, description: &#x22;Updated IANA timezone.&#x22; },
  prompt: { type: &#x22;string&#x22;, description: &#x22;Updated prompt.&#x22; },
  connected_channel_id: { type: &#x22;string&#x22;, description: &#x22;Updated platform `channel_id`.&#x22; },
  job_type: { type: &#x22;string&#x22;, description: &#x22;`slack` or `discord`.&#x22; },
  is_threaded: { type: &#x22;boolean&#x22;, description: &#x22;Updated threading preference.&#x22; },
  is_enabled: { type: &#x22;boolean&#x22;, description: &#x22;Enable or disable the job. Re-enabling a disabled job resets `last_executed_at` to prevent immediate execution.&#x22; }
}"
/>

## Example [#example]

<Tabs items="[&#x22;bash&#x22;, &#x22;TypeScript&#x22;, &#x22;Ruby&#x22;, &#x22;Python&#x22;, &#x22;Go&#x22;]">
  <Tab value="bash">
    ```bash
    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
      }'
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    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();
    ```
  </Tab>

  <Tab value="Ruby">
    ```ruby
    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)
    ```
  </Tab>

  <Tab value="Python">
    ```python
    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()
    ```
  </Tab>

  <Tab value="Go">
    ```go
    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)
    }
    ```
  </Tab>
</Tabs>

## Response [#response]

```json
{
  "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"
}
```
