GET
/
accounts
/
{account_id}
/
status
JavaScript
import Surge from '@surgeapi/node';

const client = new Surge({
  apiKey: 'My API Key',
});

const accountStatus = await client.accounts.retrieveStatus('acct_01jpqjvfg9enpt7pyxd60pcmxj');

console.log(accountStatus.capabilities);
{
  "capabilities": {
    "local_messaging": {
      "errors": [
        {
          "field": "organization.registered_name",
          "message": "The provided EIN doesn't match the organization's registered name.",
          "type": "ein_mismatch"
        }
      ],
      "fields_needed": [],
      "status": "error"
    },
    "phone_calls": {
      "errors": [],
      "fields_needed": [],
      "status": "ready"
    },
    "toll_free_messaging": {
      "errors": [],
      "fields_needed": [
        "organization.contact.title_other",
        "organization.mobile_number"
      ],
      "status": "incomplete"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

account_id
string
required

ID of the account to check

Example:

"acct_01jpqjvfg9enpt7pyxd60pcmxj"

Query Parameters

capabilities
enum<string>[]

capabilities about which to check the status

Example:

"local_messaging"

Response

Account status

Response containing account status information

capabilities
object
required

An object where the fields are the capabilities passed in the capabilities query param, as in local_messaging.