> For the complete documentation index, see [llms.txt](https://developer.sahamati.org.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.sahamati.org.in/sahamatinet-agent-sna/billing/api-reference/response-codes.md).

# Response Codes

The Sahamati billing endpoint returns the following HTTP responses for each push request made by SNA:

<table><thead><tr><th width="96.3333740234375">Code</th><th width="143.6666259765625">Status</th><th>Response Body</th></tr></thead><tbody><tr><td>200</td><td>OK</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "status": "accepted", "blob_file": "aa-test-001/mc-test-0001" }</td></tr><tr><td>400</td><td>Bad Request</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "Bad request", "errorMsg": "Please provide a valid API key" }</td></tr><tr><td>400</td><td>Bad Request</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "", "errorCode": "Bad request", "errorMsg": "Required field(s) missing: metricCollectionId" }</td></tr><tr><td>400</td><td>Bad Request</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "Bad request", "errorMsg": "aaId does not match the authenticated caller" }</td></tr><tr><td>401</td><td>Unauthorized</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "auth_error", "errorMsg": "Auth token is invalid/expired" }</td></tr><tr><td>403</td><td>Forbidden</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "ip_not_whitelisted", "errorMsg": "Access denied. Your IP is not whitelisted" }</td></tr><tr><td>429</td><td>Too Many Requests</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "Rate limit exceeded", "errorMsg": "Rate limit exceeded. Try again in 5 minutes." }</td></tr><tr><td>502</td><td>Bad Gateway</td><td>{ "ver": "1.0", "timestamp": "2026-09-24T10:15:30Z", "txnId": "txn-test-0001", "errorCode": "processing_error", "errorMsg": "ingest failed, retry is safe" }</td></tr></tbody></table>

A 429 response includes a `Retry-After` header with the wait time in seconds. For a 400 validation failure, `txnId` may be empty if the payload could not be parsed far enough to read it.

> 📌 A billing payload resubmitted with the same `txnId` is accepted with HTTP 200, so retrying after a 429 or 502 is safe.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.sahamati.org.in/sahamatinet-agent-sna/billing/api-reference/response-codes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
