JavaScript
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);
}import os
from surge import Surge
client = Surge(
api_key=os.environ.get("SURGE_API_KEY"), # This is the default and can be omitted
)
page = client.accounts.list()
page = page.data[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/surge-go"
"github.com/stainless-sdks/surge-go/option"
)
func main() {
client := surge.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Accounts.List(context.TODO(), surge.AccountListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
page = surge.accounts.list
puts(page)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Surge\Client;
use Surge\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('SURGE_API_KEY') ?: 'My API Key');
try {
$page = $client->accounts->list(after: 'after', before: 'before');
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}curl --request GET \
--url https://api.surge.app/accounts \
--header 'Authorization: Bearer <token>'HttpResponse<String> response = Unirest.get("https://api.surge.app/accounts")
.header("Authorization", "Bearer <token>")
.asString();{
"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"
}
}Accounts
List accounts
Return all accounts under your project. Useful for syncing the accounts you manage and inspecting their carrier registration status.
GET
/
accounts
JavaScript
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);
}import os
from surge import Surge
client = Surge(
api_key=os.environ.get("SURGE_API_KEY"), # This is the default and can be omitted
)
page = client.accounts.list()
page = page.data[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/surge-go"
"github.com/stainless-sdks/surge-go/option"
)
func main() {
client := surge.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Accounts.List(context.TODO(), surge.AccountListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
page = surge.accounts.list
puts(page)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Surge\Client;
use Surge\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('SURGE_API_KEY') ?: 'My API Key');
try {
$page = $client->accounts->list(after: 'after', before: 'before');
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}curl --request GET \
--url https://api.surge.app/accounts \
--header 'Authorization: Bearer <token>'HttpResponse<String> response = Unirest.get("https://api.surge.app/accounts")
.header("Authorization", "Bearer <token>")
.asString();{
"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"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Cursor for forward pagination. Use the next_cursor from a previous response.
Cursor for backward pagination. Use the previous_cursor from a previous response.
Response
List of accounts
A paginated list of accounts
⌘I