# Update

Partial update of an agent's description and system prompt.





Partial update. Send only the fields you want to change.

```http
PATCH /api/public/v1/agents/{agent_id}
```

`{agent_id}` accepts either the ULID (`cci_...`) or the human-readable slug (the agent's `agent_id` field).

## Request body [#request-body]

<TypeTable
  type="{
  description: {
    type: &#x22;string&#x22;,
    description: &#x22;Agent description.&#x22;
  },
  system_prompt: {
    type: &#x22;string | null&#x22;,
    description: &#x22;Custom system prompt. Three accepted forms: pass a string to set the prompt to that value; pass explicit JSON `null` to clear the custom prompt and revert to the platform default; omit the field to leave the stored value untouched. Note: empty string `\&#x22;\&#x22;` is NOT the same as `null` — `\&#x22;\&#x22;` stores an empty prompt, `null` reverts to the default.&#x22;
  }
}"
/>

<Callout type="info">
  Sending an empty body (`{}`) is accepted as a no-op. `updated_at` is not bumped when no fields actually change.
</Callout>

## 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/agents/AGENT_ID \
      -H "Authorization: Bearer $NAIRI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "description": "Updated description",
        "system_prompt": "You are a helpful coding assistant."
      }'
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    const res = await fetch(`https://api.nairi.ai/api/public/v1/agents/${agentId}`, {
      method: "PATCH",
      headers: {
        Authorization: `Bearer ${process.env.NAIRI_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        description: "Updated description",
        system_prompt: "You are a helpful coding assistant.",
      }),
    });
    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/agents/#{agent_id}")
    req = Net::HTTP::Patch.new(uri)
    req["Authorization"] = "Bearer #{ENV['NAIRI_API_KEY']}"
    req["Content-Type"] = "application/json"
    req.body = {
      description: "Updated description",
      system_prompt: "You are a helpful coding assistant.",
    }.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/agents/{agent_id}",
        headers={
            "Authorization": f"Bearer {os.environ['NAIRI_API_KEY']}",
            "Content-Type": "application/json",
        },
        json={
            "description": "Updated description",
            "system_prompt": "You are a helpful coding assistant.",
        },
    )
    data = res.json()
    ```
  </Tab>

  <Tab value="Go">
    ```go
    package main

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

    func main() {
    	agentID := os.Getenv("AGENT_ID")
    	body, _ := json.Marshal(map[string]any{
    		"description":   "Updated description",
    		"system_prompt": "You are a helpful coding assistant.",
    	})
    	req, _ := http.NewRequest("PATCH", "https://api.nairi.ai/api/public/v1/agents/"+agentID, 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": "cci_01KEQ6963XS96YDP3NF9NKB7QJ",
  "name": "My Agent",
  "agent_id": "my-agent",
  "instances_count": 1,
  "description": "Updated description",
  "is_self_hosted": false,
  "system_prompt": "You are a helpful coding assistant.",
  "created_at": "2026-04-12T18:45:12.000Z",
  "updated_at": "2026-04-12T18:50:00.000Z"
}
```

<Callout type="info">
  After updating the system prompt, redeploy with `update_config_only: true` for the change to take effect on running agents. See [Deploy](/api/agents/deploy).
</Callout>
