Skip to content

POST /apiv2/time/delete

Remove a TRON address from Host Mode entirely. By default the address must already be inactive (stopped) and have no open orders; pass "stop": true to stop it and delete it in one call.

Endpoint URL

POST https://netts.io/apiv2/time/delete

Authentication

Provide your API key in the request body (api_key) or the X-API-KEY header. The request IP must be in the whitelist configured for your API key.

Request Body

json
{
    "api_key": "your_api_key",
    "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
    "stop": true
}

Parameters

ParameterTypeRequiredDescription
api_keystringYesAPI key (or X-API-KEY header).
addressstringYesTRON (TRC-20) address, ^T[1-9A-HJ-NP-Za-km-z]{33}$. Must belong to your account.
stopbooleanNotrue — stop Host Mode on the address before deleting it, instead of refusing the call. Saves a separate request to /apiv2/time/stop. Defaults to false.

Behaviour

  • Without stop, the address must be inactive — stop it first with /apiv2/time/stop if it is active — and must have no open orders. Otherwise the call is refused with the errors below and nothing is changed.
  • On success, the address is removed from Host Mode and its registered callback URL (if any) is deleted.
  • The same address can be added again later with /apiv2/time/add.

stop

With "stop": true an active address is stopped and deleted in one call — the same result as calling /apiv2/time/stop and then /apiv2/time/delete, and exactly the same actions: all open orders for the address are closed, Host Mode is switched off, the cycle counter is reset, and the stop is written to your action history. Only then is the address deleted.

Both steps run in one transaction: either the address is stopped and deleted, or nothing changes at all. There is no state where the address ends up stopped but still registered.

The flag only matters when there is something to stop. On an address that is already inactive and has no open orders it changes nothing — the call behaves exactly as without it, and the response is the plain delete response.

Billing is unaffected: stopping does not refund anything and deleting does not charge anything. Cycles already delegated stay charged, and energy currently delegated to the address is reclaimed on its normal schedule. See Host Mode → Cycles and Pricing.

Example Requests

cURL

bash
curl -X POST https://netts.io/apiv2/time/delete \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY_HERE",
    "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
  }'

Stop and delete in one call:

bash
curl -X POST https://netts.io/apiv2/time/delete \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY_HERE",
    "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
    "stop": true
  }'

Python

python
import requests

resp = requests.post(
    "https://netts.io/apiv2/time/delete",
    json={
        "api_key": "YOUR_API_KEY_HERE",
        "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
        # "stop": True,  # optional: stop Host Mode on the address instead of failing
    },
    timeout=30,
)
result = resp.json()

if result["code"] == 0:
    print("Deleted:", result["data"]["address"])
else:
    print("Error:", result["msg"])

Node.js

javascript
const axios = require('axios');

axios.post('https://netts.io/apiv2/time/delete', {
    api_key: 'YOUR_API_KEY_HERE',
    address: 'TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE',
    // stop: true, // optional: stop Host Mode on the address instead of failing
}).then(({ data: result }) => {
    if (result.code === 0) console.log('Deleted:', result.data.address);
    else console.error('Error:', result.msg);
}).catch(err => console.error('Request failed:', err.response?.data || err.message));

Response

Success (200 OK)

json
{
    "code": 0,
    "msg": "Address deleted from Host Mode successfully",
    "data": {
        "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
        "timestamp": "2026-07-13T05:30:15.123456"
    }
}

Success when the address was stopped first ("stop": true)

json
{
    "code": 0,
    "msg": "Address stopped and deleted from Host Mode successfully",
    "data": {
        "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
        "stopped": true,
        "orders_closed": 1,
        "timestamp": "2026-07-13T05:30:15.123456"
    }
}

Response Fields

FieldTypeDescription
codeinteger0 = success, negative = error
msgstringHuman-readable message. Address stopped and deleted from Host Mode successfully when the address was stopped as part of the call
data.addressstringThe address that was removed
data.stoppedbooleanPresent only when Host Mode was stopped as part of this call. Absent on a plain delete
data.orders_closedintegerNumber of open orders closed by that stop. Present only alongside stopped
data.timestampstringISO timestamp

Error Responses

All errors use code = -1:

msgCause
API key required in X-API-KEY header or request bodyNo API key provided
Invalid API key or IP not in whitelistAuthentication failed
Invalid TRC-20 address formatBad address format
Address not found or does not belong to youAddress is not registered under your account
Cannot delete an active address. Stop Host mode firstAddress is active and stop was not set — call /apiv2/time/stop first, or repeat with "stop": true
Cannot delete address with active ordersThe address still has open orders and stop was not set — repeat with "stop": true
Failed to delete addressThe address could not be removed — retry
Database error deleting addressTemporary server-side error — retry
Internal server errorUnexpected error — retry or contact support
json
{ "code": -1, "msg": "Cannot delete an active address. Stop Host mode first", "data": null }

HTTP status codes

Endpoint errors are returned with HTTP 200 and a negative code — check code, not the HTTP status. Error bodies always include "data": null.

Some errors are returned before the request reaches the endpoint. They use a non-200 status and a different body shape:

HTTPBodyCause
403{"detail": {"code": 1005, "msg": "API key is blocked. Contact support."}}The API key is blocked — contact support
422{"detail": [ … ]}Request body failed validation: a required field is missing or has the wrong type. Note there is no code field in this response

Deleting an address is always available regardless of your account balance.

Notes

  • Deleting also removes the address's callback URL.
  • Delete is only allowed for inactive addresses with no open orders — stop it first with /apiv2/time/stop, or pass "stop": true here to have it stopped for you.
  • The same address can be re-added at any time.