skip to content
superbot.gg

Steer a running cloud run

Part of Runs, 7 operations. The overview covers keys, scopes and errors.

POST /v1/runs/{run_id}/messages

Add a note to a run that is queued or running. The run is not restarted: it reads the note at its next step boundary (never mid-step) and carries on with it as a note from you. Notes are applied oldest first. Refusals: 409 run_not_active (the run settled); 400 invalid_note or note_too_long (over 8192 bytes); 429 too_many_notes (20 notes already waiting), with Retry-After. The run's events record note_queued and note_delivered with the note id and length, never its text.

A caller key holding runs:write (Authorization: Bearer sbc_… or x-api-key: sbc_…), or a signed-in session.

Operation id sendRunMessage in Runs.

Path parameters

  • run_id string required

    The run id (a Run id).

Request body

application/json, required.

  • text string required

    The note, up to 8192 bytes of UTF-8.

Response 202

The note, queued.

application/json: RunNote.

  • id string required
  • object string required

    One of run.note.

  • run_id string required
  • queued_at string required

Errors

StatusCodeWhat to change
400invalid_request

A parameter or body field is invalid; param names it and issues lists every problem.

401unauthorized

Send a live caller key or session as Authorization: Bearer … or x-api-key. No key yet: create one at /account/api, or sign a user in at /auth.md.

403insufficient_scope

The key lacks the scope in required_scopes; mint a key that holds it.

404not_found

No such resource on this account; check the id.

409conflict

The resource is not in a state that allows this change.

429rate_limited

Over the per-key request bucket; retry after x-ratelimit-reset.

view .mdopenapi
Request

curl

curl -sS -X POST "https://superbot.gg/v1/runs/$RUN_ID/messages" \
  -H "Authorization: Bearer $SUPERBOT_API_KEY" \
  -H "content-type: application/json" \
  -d '{"text":"Skip the migration for now and focus on the failing test."}'

JavaScript

const runId = 'RUN_ID';
const res = await fetch(`https://superbot.gg/v1/runs/${runId}/messages`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.SUPERBOT_API_KEY}`,
    'content-type': 'application/json',
  },
  body: JSON.stringify({"text":"Skip the migration for now and focus on the failing test."}),
});
console.log(res.status, await res.json());

Python

import os
import requests

run_id = "RUN_ID"
res = requests.request(
    "POST",
    f"https://superbot.gg/v1/runs/{run_id}/messages",
    headers={
        "Authorization": f"Bearer {os.environ['SUPERBOT_API_KEY']}",
        "content-type": "application/json",
    },
    json={"text":"Skip the migration for now and focus on the failing test."},
)
print(res.status_code, res.json())
Response

202 The note, queued.

{
  "id": "note_4f1c9a0b2e7d6c3a18",
  "object": "run.note",
  "run_id": "your-run-id",
  "queued_at": "your-queued-at"
}

400 The request is malformed or a parameter is invalid; `param` names the field.

{
  "error": "invalid_request",
  "message": "A parameter or body field is invalid; param names it and issues lists every problem.",
  "doc_url": "https://superbot.gg/developers#errors-invalid_request",
  "request_id": "req_5f1c0a9e2b7d4c3a1e0f9b8d"
}

401 The bearer is missing, malformed or unknown.

{
  "error": "unauthorized",
  "message": "Send a live caller key or session as Authorization: Bearer … or x-api-key. No key yet: create one at /account/api, or sign a user in at /auth.md.",
  "doc_url": "https://superbot.gg/developers#errors-unauthorized",
  "request_id": "req_5f1c0a9e2b7d4c3a1e0f9b8d"
}

403 The key lacks a scope (insufficient_scope), is revoked, or may not call this route.

{
  "error": "insufficient_scope",
  "message": "The key lacks the scope in required_scopes; mint a key that holds it.",
  "doc_url": "https://superbot.gg/developers#errors-insufficient_scope",
  "request_id": "req_5f1c0a9e2b7d4c3a1e0f9b8d"
}

404 No such resource on this account.

{
  "error": "not_found",
  "message": "No such resource on this account; check the id.",
  "doc_url": "https://superbot.gg/developers#errors-not_found",
  "request_id": "req_5f1c0a9e2b7d4c3a1e0f9b8d"
}

409 The resource is not in a state that allows this change.

{
  "error": "conflict",
  "message": "The resource is not in a state that allows this change.",
  "doc_url": "https://superbot.gg/developers#errors-conflict",
  "request_id": "req_5f1c0a9e2b7d4c3a1e0f9b8d"
}

429 Over the per-key request bucket; retry after x-ratelimit-reset.

{
  "error": "rate_limited",
  "message": "Over the per-key request bucket; retry after x-ratelimit-reset.",
  "doc_url": "https://superbot.gg/developers#errors-rate_limited",
  "request_id": "req_5f1c0a9e2b7d4c3a1e0f9b8d"
}