Preview: the API is being built and these endpoints may change

GET/api/v1/channels

List channels

Every line you sell through, with its credit and health.

Returns each channel your sales go out through, with credit, status and success rate over the last 24 hours. A live key lists your lines; a test key lists the test channel. Pages work as in List transactions: limit (up to 100, default 25) and cursor.

Request

bash
curl https://api.simconnectng.com/api/v1/channels \
  -H "Authorization: Bearer $SIMCONNECT_KEY"

Response

json
{
  "success": true,
  "data": {
    "items": [
      { "id": "0192d7b2-6c1a-7f3e-9b4d-2a5c8e1f7b30", "kind": "line", "network": "mtn", "status": "active", "balance": 32050.00, "success_rate": 0.98 },
      { "id": "0192d7b2-9e4f-7a1c-8d2b-5f6a3c9e0d41", "kind": "line", "network": "glo", "status": "low_credit", "balance": 3900.00, "success_rate": 0.95 }
    ],
    "page": { "next_cursor": null, "has_more": false }
  },
  "message": "OK",
  "code": "OK"
}

A line's status is active, low_credit, disabled, blocked or reconnect (its network session ended and it needs connecting again). Lines low on credit step aside from routing on their own. success_rate runs from 0 to 1. In test mode the one channel has id mock, a network and balance of null, and serves every network. The figures shown here are placeholders.

Error

json
{ "success": false, "data": null, "message": "API key required", "code": "AUTH_REQUIRED" }

Give this to your coding agent

prompt
Read https://simconnectng.com/docs/api/list-channels.md and implement "List channels" (GET /api/v1/channels) in this project.
Read the API key from the SIMCONNECT_KEY environment variable.
Every response is { success, data, message, code }; on an error data is null (or carries data.errors), so branch on code.