Atomside docsThis page as Markdown

Advance a test letter: advance_test_letter

Test mode only. Moves a test letter one stage on: approves it if it waits for a person (TEST 02 declines, TEST 03 lapses), then printing, printed, posted and on record. TEST 05 and TEST 06 letters are held and released or declined by a sample reviewer; TEST 07 comes back to sender after it is on record. With fail_print, a letter queued, being printed or printed fails at the printer instead and its held credits come back. Nothing is printed or posted.

MCP tooladvance_test_letter
RESTPOST /v1/letters/{letter}/advance
CLIatomside advance-test-letter
Key needsSend (letters:send)
Changes anythingYes.
Idempotency keyNot used.

Example

A real call and its real answer, made against the API in test mode. A test runs it again and fails if the answer changes. Ids, keys and links are replaced with stand-ins.

A call that works

REST:

curl -X POST https://api.atomside.com/v1/letters/ltr_example000000006/advance \
  -H "Authorization: Bearer $ATOMSIDE_API_KEY"

MCP:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "advance_test_letter",
    "arguments": {
      "letter": "ltr_example000000006"
    }
  }
}

CLI:

atomside advance-test-letter \
  --letter ltr_example000000006

The answer (HTTP 200; over MCP, the same JSON is the result's structuredContent):

{
  "letter": "ltr_example000000006",
  "from": "queued",
  "status": "printing",
  "advanced": true,
  "says": "Being printed, simulated.",
  "next": "Call advance_test_letter again."
}

Input

Over REST, fields in the path go in the path, GET fields in the query string, and POST fields in the JSON body. Over MCP, every field is an argument of the tool.

{
  "type": "object",
  "properties": {
    "letter": {
      "type": "string",
      "description": "The test letter id, ltr_…."
    },
    "fail_print": {
      "description": "Rehearse a printer failure: the letter fails at the printer instead of moving on, as letter.failed, and its held credits come back.",
      "type": "boolean"
    }
  },
  "required": [
    "letter"
  ],
  "additionalProperties": false
}

Output

{
  "type": "object",
  "properties": {
    "letter": {
      "type": "string"
    },
    "from": {
      "type": "string",
      "enum": [
        "quoted",
        "waiting_for_approval",
        "queued",
        "printing",
        "printed",
        "posted",
        "on_record",
        "declined",
        "lapsed",
        "cancelled",
        "held",
        "failed",
        "returned"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "quoted",
        "waiting_for_approval",
        "queued",
        "printing",
        "printed",
        "posted",
        "on_record",
        "declined",
        "lapsed",
        "cancelled",
        "held",
        "failed",
        "returned"
      ]
    },
    "advanced": {
      "type": "boolean",
      "description": "False when the letter has nowhere further to go."
    },
    "says": {
      "type": "string",
      "description": "A sentence to repeat to your person as it stands."
    },
    "next": {
      "type": "string"
    }
  },
  "required": [
    "letter",
    "from",
    "status",
    "advanced",
    "says",
    "next"
  ],
  "additionalProperties": false
}

Refusals

Every refusal has the same shape. Branch on code, answer and retry; repeat say to your person.

CodeAnswerRetryHTTPWhat to do next
key_missingnoafter_fix401Send the key as "Authorization: Bearer as_test_…". Ask your person if you have none.
key_not_validnonever401Ask your person for a new key. There is no link: we cannot say whose it was.
scope_missingnoafter_person403Ask your person to give the key that permission.
invalid_requestnoafter_fix400Fix the field named in details.field. The same idempotency key is fine.
rate_limitednoat_time429Wait. The same idempotency key never sends twice.
try_again_shortlynoat_time503Try again after retry_after with the same idempotency key.
account_expirednonever401Start again with start_account if your person still wants this.
connection_endednoafter_person401Tell your person. To carry on, they connect Atomside again in your assistant.
letter_not_foundnoafter_fix404Check the id with list_letters.
test_mode_onlynonever403Use a test key, or read the letter with get_letter.
key_cannot_sendnoafter_person403Give your person the quote to send, or the link to the key.
not_foundnoafter_fix404Check the name against the tool list or /v1/openapi.json.