◆ Sapport for developers API reference Error catalog OpenAPI
Sections

Account

Methods in this section: 2. All methods

MethodPathDescriptionScopesStatus
GET/meWho am I—Available
GET/walletWallet and exchange state—Available
GET /me Available

#Who am I

Returns the tenant, the integration, the key with its effective scopes, the rate limits and the wallet state. No scope is required: a valid key is enough. Handy for a connectivity check and for picking the cell.

Scopes
none required, a valid key is enough
Rate limit
read
Idempotency
not required
Successful response
200 The key and account description.

Response body

FieldTypeDescription
tenantobject
required
The tenant that owns the key.
tenant.idstring
required
tenant.namestring
required
cellstring
required
Platform cell: ru, en or id.
Values: ru en id
base_urlstring
required
Base URL of this cell API.
integrationobject
required
The integration (service account) that owns the key.
integration.idstring
required
integration.namestring
required
channel_idstring
required, may be null
The integration "api" channel; null — the channel is not created yet.
keyobject
required
key.key_idstring
required
Public key id (not a secret).
key.modestring
required

Values: live test
key.scopesarray<string>
required
Effective scopes: integration scopes ∩ the owner current permissions ∩ the licence.
Values: conversations:read conversations:write ai_seller:invoke leads:read leads:write leads:score analytics:read analytics:write dashboards:read articles:read articles:write articles:generate strategist:read strategist:write strategist:chat webhooks:manage
key.expires_atstring
required
Key expiry, ISO 8601 UTC.
key.ip_allowlistarray<string>
required, may be null
Allowed addresses and networks (CIDR); null — any address.
limitsobject
required
Request rate limits.
limits.read_per_mininteger
required
limits.write_per_mininteger
required
limits.paid_per_mininteger
required
limits.paid_concurrencyinteger
required
Concurrent paid operations per tenant.
walletobject
required
The tenant wallet (AI operations).
wallet.balanceMoney
required, may be null
The wallet balance in roubles; null — the state is unknown or the tenant is not billed.
wallet.statestring
required
ok — fine; low — running low; negative — the balance is below zero; blocked — the wallet is blocked; unknown — the state could not be obtained. Details: GET /wallet.
Values: ok low negative blocked unknown
wallet.exchangestring
required
suspended for negative and blocked: every route except /me and /wallet answers 402 wallet_suspended.
Values: active suspended
wallet.topup_urlstring
required
The dashboard address where the wallet is topped up.
wallet.daily_spendobject
required
wallet.daily_spend.limitMoney
required, may be null
The integration daily spend limit; null — not set.
wallet.daily_spend.usedMoney
required
crm_modestring
required
The tenant CRM mode: "internal" (our CRM) or an external system.

Examples

Request
curl -X GET 'https://wfacademy.org/api/public/v1/me' \
  -H 'Authorization: Bearer '"$SAPPORT_API_KEY"
Response 200
{
  "tenant": {
    "id": "EXAMPLE_ID",
    "name": "string"
  },
  "cell": "ru",
  "base_url": "https://example.com/hooks/sapport",
  "integration": {
    "id": "EXAMPLE_ID",
    "name": "string"
  },
  "channel_id": "EXAMPLE_ID",
  "key": {
    "key_id": "EXAMPLE_ID",
    "mode": "live",
    "scopes": [
      "conversations:read"
    ],
    "expires_at": "2026-10-11T09:00:00Z",
    "ip_allowlist": [
      "string"
    ]
  },
  "limits": {
    "read_per_min": 0,
    "write_per_min": 0,
    "paid_per_min": 0,
    "paid_concurrency": 0
  },
  "wallet": {
    "balance": {
      "amount": null,
      "currency": null
    },
    "state": "ok",
    "exchange": "active",
    "topup_url": "https://example.com/hooks/sapport",
    "daily_spend": {
      "limit": null,
      "used": {
        "amount": null,
        "currency": null
      }
    }
  },
  "crm_mode": "string"
}
Error example
{
  "type": "https://wfacademy.org/developers/errors#invalid_api_key",
  "title": "Invalid API key",
  "status": 401,
  "code": "invalid_api_key",
  "detail": "EXAMPLE",
  "request_id": "req_EXAMPLE"
}

Examples are illustrative: the key in them is a placeholder (EXAMPLE), field values are made up.

Possible errors

invalid_api_key wrong_cell integration_inactive tenant_inactive ip_not_allowed feature_not_in_plan rate_limited service_unavailable internal_error

GET /wallet Available

#Wallet and exchange state

Returns the tenant wallet balance, its state (ok, low, negative, blocked, unknown), whether data exchange is suspended and the top-up address. No scope is required and it works even while exchange is suspended: this is where you see why the other routes answer 402 wallet_suspended. A balance below zero or a blocked wallet suspends exchange; after a top-up it resumes by itself within 30 seconds.

Scopes
none required, a valid key is enough
Rate limit
read
Idempotency
not required
Successful response
200 The wallet state.

Response body

FieldTypeDescription
balanceMoney
required, may be null
The wallet balance in roubles (the wallet is kept in RUB on every cell); null — the state is unknown or the tenant is not billed.
statestring
required
ok — fine; low — running low (exchange continues); negative — the balance is below zero; blocked — the wallet is blocked; unknown — the state could not be obtained.
Values: ok low negative blocked unknown
exchangestring
required
suspended for negative and blocked: every route except /me and /wallet answers 402 wallet_suspended and webhooks are postponed. With unknown it stays active: free reads proceed with the Sapport-Wallet-State: unknown header, paid operations are closed (503).
Values: active suspended
topup_urlstring
required
The dashboard address where the wallet is topped up (a staff member with the top-up permission must sign in).
daily_spendobject
required, may be null
The integration daily spend; null while spend is not tracked per integration.
daily_spend.limitMoney
required, may be null
The integration daily spend limit; null — not set.
daily_spend.usedMoney
required

Examples

Request
curl -X GET 'https://wfacademy.org/api/public/v1/wallet' \
  -H 'Authorization: Bearer '"$SAPPORT_API_KEY"
Response 200
{
  "balance": {
    "amount": "123.45",
    "currency": "GBP"
  },
  "state": "ok",
  "exchange": "active",
  "topup_url": "https://example.com/hooks/sapport",
  "daily_spend": {
    "limit": null,
    "used": {
      "amount": null,
      "currency": null
    }
  }
}
Error example
{
  "type": "https://wfacademy.org/developers/errors#invalid_api_key",
  "title": "Invalid API key",
  "status": 401,
  "code": "invalid_api_key",
  "detail": "EXAMPLE",
  "request_id": "req_EXAMPLE"
}

Examples are illustrative: the key in them is a placeholder (EXAMPLE), field values are made up.

Possible errors

invalid_api_key wrong_cell integration_inactive tenant_inactive ip_not_allowed feature_not_in_plan rate_limited service_unavailable internal_error