Surge

List accounts

GET
/accounts

List all accounts for the calling platform with cursor-based pagination.

Authorization

authorization
AuthorizationBearer <token>

In: header

Query Parameters

after?string

Cursor for forward pagination. Use the next_cursor from a previous response.

before?string

Cursor for backward pagination. Use the previous_cursor from a previous response.

Response Body

application/json

application/json

import Surge from '@surgeapi/node';

const client = new Surge({
  apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const account of client.accounts.list()) {
  console.log(account.id);
}
{
  "data": [
    {
      "brand_name": "DT Precision Auto",
      "id": "acct_01jpqjvfg9enpt7pyxd60pcmxj",
      "name": "Account #2840 - DT Precision Auto",
      "organization": {
        "address": {
          "country": "US",
          "line1": "2640 Huron St",
          "line2": null,
          "locality": "Los Angeles",
          "name": "DT Precision Auto",
          "postal_code": "90065",
          "region": "CA"
        },
        "contact": {
          "email": "dom@dtprecisionauto.com",
          "first_name": "Dominic",
          "last_name": "Toretto",
          "phone_number": "+13235556439",
          "title": "other",
          "title_other": "Owner"
        },
        "country": "US",
        "email": "dom@dtprecisionauto.com",
        "identifier": "123456789",
        "identifier_type": "ein",
        "industry": "automotive",
        "mobile_number": "+13235556439",
        "regions_of_operation": [
          "usa_and_canada"
        ],
        "registered_name": "DT Precision Auto LLC",
        "stock_exchange": null,
        "stock_symbol": null,
        "type": "llc",
        "website": "https://dtprecisionauto.com"
      },
      "time_zone": "America/Los_Angeles"
    }
  ],
  "pagination": {
    "next_cursor": "g3QAAAABZAACaWRtAAAAGnBuXzAxamtzY2s5eDdkeW0wZnBxZjdjYmRyeQ==",
    "previous_cursor": null
  }
}
{
  "error": {
    "message": "The requested resource could not be found.",
    "type": "not_found"
  }
}