skip to content
superbot.gg

Decline an agent computer code

Part of Devices, 10 operations. The overview covers keys, scopes and errors.

POST /v1/pair/{user_code}/deny

Decline a pending code ("Not me"). The agent computer's next poll of its device code answers access_denied (RFC 8628 §3.5) and the code is dead. reason not_me says the user never asked for it: it is logged with the claimed vendor and the request network, and three distinct accounts reporting one network inside 24 hours count against that network's code limit. First-party only. 404 not_found for a code that is unknown, expired, approved or already declined.

Any live caller key (Authorization: Bearer sbc_… or x-api-key: sbc_…), or a signed-in session.

Operation id denyAgentPair in Devices.

Path parameters

  • user_code string required

    The code the agent computer shows (e.g. ABCD-EFGH).

Request body

application/json.

  • reason string

    Why. Default cancel. One of cancel, not_me.

Response 200

Declined.

application/json: AgentPairDenyResponse.

  • ok boolean required

    One of true.

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.

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/pair/$USER_CODE/deny" \
  -H "Authorization: Bearer $SUPERBOT_API_KEY" \
  -H "content-type: application/json" \
  -d '{"reason":"cancel"}'

JavaScript

const userCode = 'USER_CODE';
const res = await fetch(`https://superbot.gg/v1/pair/${userCode}/deny`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.SUPERBOT_API_KEY}`,
    'content-type': 'application/json',
  },
  body: JSON.stringify({"reason":"cancel"}),
});
console.log(res.status, await res.json());

Python

import os
import requests

user_code = "USER_CODE"
res = requests.request(
    "POST",
    f"https://superbot.gg/v1/pair/{user_code}/deny",
    headers={
        "Authorization": f"Bearer {os.environ['SUPERBOT_API_KEY']}",
        "content-type": "application/json",
    },
    json={"reason":"cancel"},
)
print(res.status_code, res.json())
Response

200 Declined.

{
  "ok": true
}

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"
}

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"
}