# Continue

Append another user message to a running conversation.





Appends another user message to a running job.

```http
POST /api/public/v1/conversations/{job_id}/continue
```

## Request body [#request-body]

<TypeTable
  type="{
  prompt: {
    type: &#x22;string&#x22;,
    required: true,
    description: &#x22;Additional instructions to send to the agent.&#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 POST https://api.nairi.ai/api/public/v1/conversations/JOB_ID/continue \
      -H "Authorization: Bearer $NAIRI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "prompt": "Additional instructions"
      }'
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    const res = await fetch(
      `https://api.nairi.ai/api/public/v1/conversations/${jobId}/continue`,
      {
        method: "POST",
        headers: {
          Authorization: `Bearer ${process.env.NAIRI_API_KEY}`,
          "Content-Type": "application/json",
        },
        body: JSON.stringify({ prompt: "Additional instructions" }),
      },
    );
    const data = (await res.json()) as { job_id: string; message_id: string };
    ```
  </Tab>

  <Tab value="Ruby">
    ```ruby
    require "net/http"
    require "json"
    require "uri"

    uri = URI("https://api.nairi.ai/api/public/v1/conversations/#{job_id}/continue")
    req = Net::HTTP::Post.new(uri)
    req["Authorization"] = "Bearer #{ENV['NAIRI_API_KEY']}"
    req["Content-Type"] = "application/json"
    req.body = { prompt: "Additional instructions" }.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.post(
        f"https://api.nairi.ai/api/public/v1/conversations/{job_id}/continue",
        headers={
            "Authorization": f"Bearer {os.environ['NAIRI_API_KEY']}",
            "Content-Type": "application/json",
        },
        json={"prompt": "Additional instructions"},
    )
    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{"prompt": "Additional instructions"})
    	req, _ := http.NewRequest(
    		"POST",
    		"https://api.nairi.ai/api/public/v1/conversations/"+jobID+"/continue",
    		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: `201 Created` [#response-201-created]

A new message resource is created on the job, so the response is `201 Created` (not `200 OK`).

```json
{
  "job_id": "job_01KRK1V46BXS73CSNK2VR35NPJ",
  "message_id": "cmsg_01KRK1WBPN3GSE0VWYTH4ZPN3R"
}
```

## Error responses [#error-responses]

| HTTP  | Body                                | When                                                                                                                                       |
| ----- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `404` | `{"error":"job not found"}`         | The `job_id` does not exist in the calling organization.                                                                                   |
| `400` | `{"error":"job is not an API job"}` | The job was created via Slack, Discord, or the web UI. Only jobs started through `POST /conversations/start` can be continued via the API. |
| `400` | `{"error":"prompt is required"}`    | The request body is missing `prompt`.                                                                                                      |
