Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"expanded": true,
"pages": [
"ecosystem/api/toncenter/get-api-key",
"ecosystem/api/toncenter/v3-errors",
{
"group": "API v2",
"openapi": {
Expand Down
133 changes: 133 additions & 0 deletions ecosystem/api/toncenter/v3-errors.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
---
title: "API v3 error codes"
---

## Overview

| Status | Meaning |
| ------ | ------------------------------ |
Comment on lines +7 to +8

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Numeric status columns not right-aligned

In the Overview table, the Status column header and separator (| Status | / | ------ |) do not specify right alignment, so the numeric HTTP status codes in that column render left-aligned. This violates the documented style rule that numeric columns must be right-aligned for readability and consistency (see contribute/style-guide-extended.mdx). The same pattern is repeated for all other Status columns on this page, so the misalignment affects every status code table in v3-errors.mdx. The primary location above points to the first occurrence; other instances share the same structural issue.

Suggested change
| Status | Meaning |
| ------ | ------------------------------ |
| Status | Meaning |
| ------:| ------------------------------ |

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the style guide doesn't fit this one. Left aligned error codes look better IMO
image
image

| `401` | Missing required field |
| `404` | Data not found |
| `409` | Resource exists but wrong type |
| `422` | Invalid request parameters |
| `500` | Server-side failure |

## By task

### Account & wallet info

**Endpoints:** `/api/v3/account`, `/api/v3/addressInformation`, `/api/v3/wallet`, `/api/v3/walletInformation`, `/api/v3/accountStates`, `/api/v3/walletStates`

| Status | Error | Fix |
| ------ | -------------------------------- | ----------------------------------------------- |
| `401` | `address of account is required` | Include the `address` parameter |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Error strings use code font instead of quotation marks

The error message in the "Account & wallet info" table is rendered as a code span (address of account is required) instead of being enclosed in double quotation marks. This violates the style rule that log messages and error strings must appear verbatim in quotation marks for accurate copying and grepping (see https://github.com/ton-org/docs/blob/main/contribute/style-guide-extended.mdx?plain=1#L276-L295). The same pattern is repeated across the other error tables in this page (for example, boc is required, blocks not found, and similar entries), so readers cannot easily distinguish literal messages from surrounding prose. Consistently quoting error strings also keeps the documentation aligned with actual runtime messages and reduces the risk of subtle mismatches.

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

| `409` | `not a wallet` | Account exists but isn't a wallet contract |
| `500` | `balance is none` | Indexer couldn't read balance from stored state |
| `500` | `status is none` | Indexer couldn't resolve account status |
| `500` | `last_transaction_hash is none` | No last transaction hash in indexed data |
| `500` | `last_transaction_lt is none` | No last transaction lt in indexed data |

### Sending messages

**Endpoint:** `/api/v3/message`

| Status | Error | Fix |
| ------ | ----------------- | -------------------------------------------- |
| `401` | `boc is required` | Include a serialized BoC in the request body |

### Running get methods

**Endpoint:** `/api/v3/runGetMethod`

| Status | Error | Fix |
| ------ | --------------------- | ------------------------------- |
| `401` | `address is required` | Include target contract address |
| `401` | `method is required` | Include the get-method name |

### Querying blocks & shards

**Endpoints:** `/api/v3/masterchainBlockShardState`, `/api/v3/masterchainBlockShards`

| Status | Error | Meaning |
| ------ | ------------------ | --------------------------------------- |
| `404` | `blocks not found` | Block or shard doesn't exist in storage |

### Transactions & messages

**Endpoint:** `/api/v3/transactionsByMessage`

| Status | Error | Fix |
| ------ | ----------------------------------------------------------------- | --------------------------- |
| `422` | `at least one of msg_hash, body_hash, opcode should be specified` | Provide at least one filter |

### Pending transactions & traces

**Endpoints:** `/api/v3/pendingTransactions`, `/api/v3/pendingTraces`, `/api/v3/pendingActions`

| Status | Error | Fix |
| ------ | --------------------------------------------------- | ------------------------------------------ |
| `422` | `at least 1 account address required` | Include at least one account address |
| `422` | `only one of account, trace_id should be specified` | Use only one filter |
| `422` | `account or ext_msg_hash should be specified` | Filter by account or external message hash |
| `500` | `emulatedTracesRepository is not initialized` | Server-side issue |

### Traces & events

**Endpoints:** `/api/v3/traces`, `/api/v3/events`

| Status | Error | Fix |
| ------ | ---------------------------------------------------------------------- | --------------------------- |
| `422` | `only one of account, trace_id, tx_hash, msg_hash should be specified` | Use only one primary filter |

### Address book & metadata

**Endpoints:** `/api/v3/addressBook`, `/api/v3/metadata`

| Status | Error | Fix |
| ------ | ----------------------------- | ------------------------------------- |
| `422` | `at least 1 address required` | Include a non-empty list of addresses |

### DNS records

**Endpoint:** `/api/v3/dns/records`

| Status | Error | Fix |
| ------ | --------------------------------------------------- | -------------------------------- |
| `422` | `either wallet address or domain is required` | Provide wallet address or domain |
| `422` | `provide either wallet address or domain, not both` | Use one filter, not both |

### NFT items

**Endpoint:** `/api/v3/nft/items`

| Status | Error | Fix |
| ------ | ------------------------------------------------------------------ | ------------------------------------------------------------- |
| `422` | `exact one owner_address required for multiple collection_address` | When querying multiple collections, provide exactly one owner |

### Jetton wallets

**Endpoint:** `/api/v3/jetton/wallets`

| Status | Error | Fix |
| ------ | -------------------------------------------------------------- | ---------------------------------------------------------------- |
| `422` | `exact one owner_address required for multiple jetton_address` | When querying multiple jetton masters, provide exactly one owner |

### Multisig

**Endpoints:** `/api/v3/multisig/wallets`, `/api/v3/multisig/orders`

| Status | Error | Fix |
| ------ | ----------------------------------------------------------------- | -------------------------------------------- |
| `422` | `At least one of address or wallet_address should be specified` | Filter by multisig contract or signer wallet |
| `422` | `At least one of address or multisig_address should be specified` | Filter by order address or parent multisig |

### Decoding

**Endpoint:** `/api/v3/decode`

| Status | Error | Fix |
| ------ | --------------------------------------------- | ---------------------------------------------------------------- |
| `422` | `opcodes list exceeds maximum length of 1000` | Reduce number of opcodes |
| `422` | `bodies list exceeds maximum length of 1000` | Reduce number of message bodies |
| `422` | `invalid opcode format at index %d: %s` | Fix the opcode at specified index (must be valid hex or decimal) |
| `500` | `marker request failed: <details>` | Internal decode service failed |