import Surge from '@surgeapi/node';
const client = new Surge({
apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
});
const account = await client.accounts.update('acct_01jpqjvfg9enpt7pyxd60pcmxj');
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
)
account = client.accounts.update(
id="acct_01jpqjvfg9enpt7pyxd60pcmxj",
)
print(account.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"),
)
account, err := client.Accounts.Update(
context.TODO(),
"acct_01jpqjvfg9enpt7pyxd60pcmxj",
surge.AccountUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", account.ID)
}
require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
account = surge.accounts.update("acct_01jpqjvfg9enpt7pyxd60pcmxj")
puts(account)<?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 {
$account = $client->accounts->update(
'acct_01jpqjvfg9enpt7pyxd60pcmxj',
brandName: 'DT Precision Auto',
name: 'D·T Precision Auto Shop',
organization: [
'address' => [
'country' => 'US',
'line1' => '2640 Huron St',
'line2' => null,
'locality' => 'Los Angeles',
'name' => 'DT Precision Auto',
'postalCode' => '90065',
'region' => 'CA',
],
'contact' => [
'email' => 'dom@dtprecisionauto.com',
'firstName' => 'Dominic',
'lastName' => 'Toretto',
'phoneNumber' => '+13235556439',
'title' => 'other',
'titleOther' => 'Owner',
],
'country' => 'US',
'email' => 'dom@dtprecisionauto.com',
'identifier' => '123456789',
'identifierType' => 'ein',
'industry' => 'automotive',
'mobileNumber' => '+13235556439',
'regionsOfOperation' => ['usa_and_canada'],
'registeredName' => 'DT Precision Auto LLC',
'stockExchange' => null,
'stockSymbol' => null,
'type' => 'llc',
'website' => 'https://dtprecisionauto.com',
],
timeZone: 'America/Los_Angeles',
);
var_dump($account);
} catch (APIException $e) {
echo $e->getMessage();
}curl --request PATCH \
--url https://api.surge.app/accounts/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brand_name": "DT Precision Auto",
"name": "D·T Precision Auto Shop",
"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"
}
'HttpResponse<String> response = Unirest.patch("https://api.surge.app/accounts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brand_name\": \"DT Precision Auto\",\n \"name\": \"D·T Precision Auto Shop\",\n \"organization\": {\n \"address\": {\n \"country\": \"US\",\n \"line1\": \"2640 Huron St\",\n \"line2\": null,\n \"locality\": \"Los Angeles\",\n \"name\": \"DT Precision Auto\",\n \"postal_code\": \"90065\",\n \"region\": \"CA\"\n },\n \"contact\": {\n \"email\": \"dom@dtprecisionauto.com\",\n \"first_name\": \"Dominic\",\n \"last_name\": \"Toretto\",\n \"phone_number\": \"+13235556439\",\n \"title\": \"other\",\n \"title_other\": \"Owner\"\n },\n \"country\": \"US\",\n \"email\": \"dom@dtprecisionauto.com\",\n \"identifier\": \"123456789\",\n \"identifier_type\": \"ein\",\n \"industry\": \"automotive\",\n \"mobile_number\": \"+13235556439\",\n \"regions_of_operation\": [\n \"usa_and_canada\"\n ],\n \"registered_name\": \"DT Precision Auto LLC\",\n \"stock_exchange\": null,\n \"stock_symbol\": null,\n \"type\": \"llc\",\n \"website\": \"https://dtprecisionauto.com\"\n },\n \"time_zone\": \"America/Los_Angeles\"\n}")
.asString();{
"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"
}{
"error": {
"message": "The requested resource could not be found.",
"type": "not_found"
}
}Update account
Update organization details on an existing account to fill gaps identified by the status check.
import Surge from '@surgeapi/node';
const client = new Surge({
apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
});
const account = await client.accounts.update('acct_01jpqjvfg9enpt7pyxd60pcmxj');
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
)
account = client.accounts.update(
id="acct_01jpqjvfg9enpt7pyxd60pcmxj",
)
print(account.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"),
)
account, err := client.Accounts.Update(
context.TODO(),
"acct_01jpqjvfg9enpt7pyxd60pcmxj",
surge.AccountUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", account.ID)
}
require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
account = surge.accounts.update("acct_01jpqjvfg9enpt7pyxd60pcmxj")
puts(account)<?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 {
$account = $client->accounts->update(
'acct_01jpqjvfg9enpt7pyxd60pcmxj',
brandName: 'DT Precision Auto',
name: 'D·T Precision Auto Shop',
organization: [
'address' => [
'country' => 'US',
'line1' => '2640 Huron St',
'line2' => null,
'locality' => 'Los Angeles',
'name' => 'DT Precision Auto',
'postalCode' => '90065',
'region' => 'CA',
],
'contact' => [
'email' => 'dom@dtprecisionauto.com',
'firstName' => 'Dominic',
'lastName' => 'Toretto',
'phoneNumber' => '+13235556439',
'title' => 'other',
'titleOther' => 'Owner',
],
'country' => 'US',
'email' => 'dom@dtprecisionauto.com',
'identifier' => '123456789',
'identifierType' => 'ein',
'industry' => 'automotive',
'mobileNumber' => '+13235556439',
'regionsOfOperation' => ['usa_and_canada'],
'registeredName' => 'DT Precision Auto LLC',
'stockExchange' => null,
'stockSymbol' => null,
'type' => 'llc',
'website' => 'https://dtprecisionauto.com',
],
timeZone: 'America/Los_Angeles',
);
var_dump($account);
} catch (APIException $e) {
echo $e->getMessage();
}curl --request PATCH \
--url https://api.surge.app/accounts/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brand_name": "DT Precision Auto",
"name": "D·T Precision Auto Shop",
"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"
}
'HttpResponse<String> response = Unirest.patch("https://api.surge.app/accounts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brand_name\": \"DT Precision Auto\",\n \"name\": \"D·T Precision Auto Shop\",\n \"organization\": {\n \"address\": {\n \"country\": \"US\",\n \"line1\": \"2640 Huron St\",\n \"line2\": null,\n \"locality\": \"Los Angeles\",\n \"name\": \"DT Precision Auto\",\n \"postal_code\": \"90065\",\n \"region\": \"CA\"\n },\n \"contact\": {\n \"email\": \"dom@dtprecisionauto.com\",\n \"first_name\": \"Dominic\",\n \"last_name\": \"Toretto\",\n \"phone_number\": \"+13235556439\",\n \"title\": \"other\",\n \"title_other\": \"Owner\"\n },\n \"country\": \"US\",\n \"email\": \"dom@dtprecisionauto.com\",\n \"identifier\": \"123456789\",\n \"identifier_type\": \"ein\",\n \"industry\": \"automotive\",\n \"mobile_number\": \"+13235556439\",\n \"regions_of_operation\": [\n \"usa_and_canada\"\n ],\n \"registered_name\": \"DT Precision Auto LLC\",\n \"stock_exchange\": null,\n \"stock_symbol\": null,\n \"type\": \"llc\",\n \"website\": \"https://dtprecisionauto.com\"\n },\n \"time_zone\": \"America/Los_Angeles\"\n}")
.asString();{
"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"
}{
"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.
Path Parameters
The ID for the account to update.
"acct_01jpqjvfg9enpt7pyxd60pcmxj"
Body
Parameters for updating an existing account.
The name by which the people this account communicates with know it. If not provided, this will match the name field.
The name of the account that will be visible for your internal organizational purposes. This will also be the default public-facing brand name unless you also set a brand_name, but otherwise the account name will never be displayed anywhere outside of Surge HQ, and may include your ID for the account or anything else that may help you.
Parameters describing the legal entity on whose behalf the account will be operated.
Show child attributes
Show child attributes
The time zone for the account
"America/Los_Angeles"
Response
Updated account
Response containing account information.
The name by which the people this account communicates with know it. If not provided, this will match the name field.
The account ID
The name of the account that will be visible for your internal organizational purposes. This will also be the default public-facing brand name unless you also set a brand_name, but otherwise the account name will never be displayed anywhere outside of Surge HQ, and may include your ID for the account or anything else that may help you.
The legal entity on whose behalf the account will be operated.
Show child attributes
Show child attributes
This is the time zone in which the account is headquartered. This time zone may be used for compliance with TCPA restrictions on when messages may be sent.
"America/Los_Angeles"