List

View as Markdown

Use this endpoint for the Accounts method to list all accounts. Optionally, you can use the FriendlyName parameter to filter by that exact FriendlyName.

This route is present to be API compatible with other providers. Note that, since authentication on SignalWire is specific to a Project, this endpoint will return a list that contains only the Project you are connecting as.

Query parameters

FriendlyNamestringOptional
A named unique identifier for the resource. Allowed characters: `A-Za-z0-9_-`. Maximum of 100 characters.
PageintegerOptional>=0Defaults to 0
The page number to retrieve. Page numbers are zero-indexed, so the first page is 0.
PageSizeintegerOptional1-1000Defaults to 50
The number of results to return per page. The default is 50, and the maximum is 1000.
PageTokenstringOptional
A token used to retrieve a specific page of results. The token is returned in the response of a previous request.

Response

uristringRequired
The URI of the current page.
first_page_uristringRequired
The URI of the first page.
next_page_uristring or nullRequired
The URI of the next page. Null if there are no more results.
previous_page_uristring or nullRequired
The URI of the previous page. Null if this is the first page.
pageintegerRequired
The current page number (zero-indexed).
page_sizeintegerRequired
The number of results per page.
accountslist of objectsRequired
List of accounts.
Response
1{
2 "uri": "/api/laml/2010-04-01/Accounts?Page=0&PageSize=50",
3 "first_page_uri": "/api/laml/2010-04-01/Accounts?Page=0&PageSize=50",
4 "next_page_uri": "/api/laml/2010-04-01/Accounts?Page=1&PageSize=50",
5 "previous_page_uri": "string",
6 "page": 0,
7 "page_size": 50,
8 "accounts": [
9 {
10 "sid": "b3877c40-da60-4998-90ad-b792e98472af",
11 "friendly_name": "My Project",
12 "status": "active",
13 "auth_token": "redacted",
14 "date_created": "Sat, 15 Sep 2018 10:00:00 +0000",
15 "date_updated": "Sat, 16 Sep 2018 10:00:00 +0000",
16 "type": "Full",
17 "owner_account_sid": "b3877c40-da60-4998-90ad-b792e98472af",
18 "region_preference": "us-east",
19 "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af",
20 "subproject": false,
21 "signing_key": "string",
22 "subresource_uris": {
23 "available_phone_numbers": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers",
24 "applications": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Applications",
25 "calls": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls",
26 "conferences": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Conferences",
27 "incoming_phone_numbers": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/IncomingPhoneNumbers",
28 "queues": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Queues",
29 "recordings": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Recordings",
30 "messages": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Messages",
31 "transcriptions": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Transcriptions"
32 }
33 }
34 ]
35}

Request examples

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client.api.accounts.each(accounts => console.log(accounts.sid));