- Particle
- constructor
- login
- sendOtp
- enableMfa
- confirmMfa
- disableMfa
- createCustomer
- loginAsClientOwner
- createUser
- verifyUser
- resetPassword
- deleteAccessToken
- deleteCurrentAccessToken
- deleteActiveAccessTokens
- deleteUser
- trackingIdentity
- listDevices
- getDevice
- claimDevice
- addDeviceToProduct
- removeDevice
- removeDeviceOwner
- renameDevice
- signalDevice
- setDeviceNotes
- markAsDevelopmentDevice
- lockDeviceProductFirmware
- unlockDeviceProductFirmware
- updateDevice
- unprotectDevice
- provisionDevice
- getClaimCode
- getVariable
- flashDevice
- flashTinker
- compileCode
- downloadFirmwareBinary
- sendPublicKey
- callFunction
- getEventStream
- publishEvent
- Hook
- createWebhook
- deleteWebhook
- listWebhooks
- createIntegration
- editIntegration
- deleteIntegration
- listIntegrations
- getUserInfo
- setUserInfo
- changeUsername
- changeUserPassword
- listSIMs
- getSIMDataUsage
- getFleetDataUsage
- checkSIM
- activateSIM
- deactivateSIM
- reactivateSIM
- updateSIM
- removeSIM
- listBuildTargets
- listLibraries
- getLibrary
- getLibraryVersions
- contributeLibrary
- publishLibrary
- deleteLibrary
- downloadFile
- listOAuthClients
- createOAuthClient
- updateOAuthClient
- deleteOAuthClient
- listProducts
- getProduct
- listProductFirmware
- uploadProductFirmware
- getProductFirmware
- updateProductFirmware
- downloadProductFirmware
- releaseProductFirmware
- listTeamMembers
- inviteTeamMember
- removeTeamMember
- lookupSerialNumber
- createMeshNetwork
- removeMeshNetwork
- listMeshNetworks
- getMeshNetwork
- updateMeshNetwork
- addMeshNetworkDevice
- removeMeshNetworkDevice
- listMeshNetworkDevices
- getProductConfiguration
- getProductConfigurationSchema
- getProductDeviceConfiguration
- getProductDeviceConfigurationSchema
- setProductConfiguration
- setProductDeviceConfiguration
- getProductLocations
- getProductDeviceLocations
- executeLogic
- createLogicFunction
- getLogicFunction
- updateLogicFunction
- deleteLogicFunction
- listLogicFunctions
- listLogicRuns
- getLogicRun
- getLogicRunLogs
- createLedger
- getLedger
- updateLedger
- archiveLedger
- Scope
- listLedgers
- getLedgerInstance
- SetMode
- setLedgerInstance
- deleteLedgerInstance
- listLedgerInstances
- listLedgerInstanceVersions
- getLedgerInstanceVersion
- listDeviceOsVersions
- getDeviceOsVersion
- setDefaultAuth
- get
- head
- post
- put
- delete
- request
Particle Cloud API wrapper.
See https://docs.particle.io/reference/javascript/ for examples
of using the Particle
class.
Most Particle methods take a single unnamed argument object documented as
options
with key/value pairs for each option.
Parameters
options
(optional, default{}
)
Contructor for the Cloud API wrapper.
Create a new Particle object and call methods below on it.
Parameters
options
Object Options for this API call Options to be used for all requests (see Defaults) (optional, default{}
)
Login to Particle Cloud using an existing Particle acccount.
Parameters
options
Object Options for this API calloptions.username
String Username for the Particle accountoptions.password
String Password for the Particle accountoptions.tokenDuration
Number How long the access token should last in seconds (optional, defaultthis.tokenDuration
)options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Number? Request context
Returns Promise A promise
If login failed with an 'mfa_required' error, this must be called with a valid OTP code to login
Parameters
options
Object Options for this API calloptions.mfaToken
String Given as 'mfa_token' in the error body of.login()
.options.otp
String Current one-time-password generated from the authentication applicationoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Number? Request context
Returns Promise A promise
Enable MFA on the currently logged in user
Parameters
options
Object Options for this API call
Returns Promise A promise
Confirm MFA for the user. This must be called with current TOTP code, determined from the results of enableMfa(). You will be prompted to enter an OTP code every time you login after enrollment is confirmed.
Parameters
options
Object Options for this API calloptions.mfaToken
Object Token given from previous step tooptions.otp
Object Current one-time-password generated from the authentication appoptions.invalidateTokens
Boolean Should all tokens be invalidated (optional, defaultfalse
)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Disable MFA for the user.
Parameters
options
Object Options for this API call
Returns Promise A promise
Create Customer for Product.
Parameters
options
Object Options for this API calloptions.email
String Username for the Particle accountoptions.password
String Password for the Particle accountoptions.product
String Create the customer in this product ID or slugoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Login to Particle Cloud using an OAuth client.
Parameters
options
Object Options for this API call
Returns Promise A promise
Create a user account for the Particle Cloud
Parameters
options
Object Options for this API calloptions.username
String Email of the new useroptions.password
String Passwordoptions.accountInfo
String Object that contains account information fields such as user real name, company name, business account flag etcoptions.utm
Object? Object that contains info about the campaign that lead to this user creationoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Verify new user account via verification email
Parameters
options
Object Options for this API call
Returns Promise A promise
Send reset password email for a Particle Cloud user account
Parameters
options
Object Options for this API call
Returns Promise A promise
Revoke an access token
Parameters
options
Object Options for this API call
Returns Promise A promise
Revoke the current session access token
Parameters
options
Object Options for this API call
Returns Promise A promise
Revoke all active access tokens
Parameters
options
Object Options for this API call
Returns Promise A promise
Delete the current user
Parameters
options
Object Options for this API call
Returns Promise A promise
Retrieves the information that is used to identify the current login for tracking.
Parameters
options
Object? Options for this API call (optional, default{}
)options.full
Boolean? When true, retrieve all information for registering a user with the tracking API. When false, retrieve only the unique tracking ID for the current login. (optional, defaultfalse
)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<Object> Resolve the tracking identify of the current login
List devices claimed to the account or product
Parameters
options
Object Options for this API calloptions.deviceId
String? (Product only) Filter results to devices with this ID (partial matching)options.deviceName
String? (Product only) Filter results to devices with this name (partial matching)options.groups
Array<string>? (Product only) A list of full group names to filter results to devices belonging to these groups only.options.sortAttr
String? (Product only) The attribute by which to sort results. See API docs for options.options.sortDir
String? (Product only) The direction of sorting. See API docs for options.options.page
Number? (Product only) Current page of resultsoptions.perPage
Number? (Product only) Records per pageoptions.product
String? List devices in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Get detailed informationa about a device
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.product
String? Device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Claim a device to the account. The device must be online and unclaimed.
Parameters
options
Object Options for this API calloptions.deviceId
String Device IDoptions.requestTransfer
boolean True to request the device be transfered from another useroptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Add a device to a product or move device out of quarantine.
Parameters
options
Object Options for this API calloptions.deviceId
String Device IDoptions.product
String Add to this product ID or slugoptions.file
Object A file that contains a single-column list of device IDs, device serial numbers, device IMEIs, or devie ICCIDs. Node: Either a path or Buffer. Browser: a File or Blob.options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Unclaim / Remove a device from your account or product, or deny quarantine
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.deny
Boolean? (Product only) Deny this quarantined device, instead of removing an already approved deviceoptions.product
String Remove from this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Unclaim a product device its the owner, but keep it in the product
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.product
String Remove from this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Rename a device
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.name
String Desired Nameoptions.product
String? Rename device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Instruct the device to turn on/off the LED in a rainbow pattern
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.signal
Boolean Signal on or offoptions.product
String? Device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Store some notes about device
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.notes
String Your notes about this deviceoptions.product
String? Device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Mark device as being used in development of a product so it opts out of automatic firmware updates
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.development
Boolean Set to true to mark as development, false to return to product fleet (optional, defaulttrue
)options.product
String Device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Mark device as being used in development of a product, so it opts out of automatic firmware updates
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.desiredFirmwareVersion
Number Lock the product device to run this firmware version.options.flash
Boolean? Immediately flash firmware indicated by desiredFirmwareVersionoptions.product
String Device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Mark device as receiving automatic firmware updates
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.product
String Device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Update multiple device attributes at the same time
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.name
String? Desired Nameoptions.signal
Boolean? Signal device on or offoptions.notes
String? Your notes about this deviceoptions.development
Boolean? (Product only) Set to true to mark as development, false to return to product fleetoptions.desiredFirmwareVersion
(Number | null)? (Product only) Lock the product device to run this firmware version. Passnull
to unlock firmware and go back to released firmware.options.flash
Boolean? (Product only) Immediately flash firmware indicated by desiredFirmwareVersionoptions.product
String? Device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Disable device protection.
Parameters
options
Object Options for this API call.options.deviceId
String Device ID or name.options.org
String? Organziation ID or slug.options.product
String? Product ID or slug.options.action
String Request action:prepare
orconfirm
.options.serverNonce
String? Base64-encoded server nonce. Mandatory ifaction
isconfirm
,options.deviceNonce
String? Base64-encoded device nonce. Mandatory ifaction
isconfirm
,options.deviceSignature
String? Base64-encoded device signature. Mandatory ifaction
isconfirm
,options.devicePublicKeyFingerprint
String? Base64-encoded fingerprint of the device public key. Mandatory ifaction
isconfirm
,options.auth
string? The access token. Can be ignored if provided in constructor.options.headers
Object? Key/value pairs to send as headers.options.context
Object? Request context.
Returns Promise A promise
Provision a new device for products that allow self-provisioning
Parameters
options
Object Options for this API call
Returns Promise A promise
Generate a claim code to use in the device claiming process. To generate a claim code for a product, the access token MUST belong to a customer of the product.
Parameters
options
Object Options for this API calloptions.iccid
String? ICCID of the SIM card used in the Electronoptions.product
String? Device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Get the value of a device variable
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.name
String Variable nameoptions.product
String? Device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Compile and flash application firmware to a device. Pass a pre-compiled binary to flash it directly to the device.
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.product
String Flash device in this product ID or slugoptions.files
Object Object containing files to be compiled and flashed. Keys should be the filenames, including relative path, and the values should be a path or Buffer of the file contents in Node, or a File or Blob in the browser.options.targetVersion
String System firmware version to compile against (optional, defaultlatest
)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
DEPRECATED: Flash the Tinker application to a device. Instead compile and flash the Tinker source code.
Parameters
options
Object Options for this API call
Returns Promise A promise
Compile firmware using the Particle Cloud
Parameters
options
Object Options for this API calloptions.files
Object Object containing files to be compiled. Keys should be the filenames, including relative path, and the values should be a path or Buffer of the file contents in Node, or a File or Blob in the browser.options.platformId
Number? Platform id number of the device you are compiling for. Common values are 0=Core, 6=Photon, 10=Electron.options.targetVersion
String System firmware version to compile against (optional, defaultlatest
)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Download a firmware binary
Parameters
options
Object Options for this API call
Returns Promise<RequestResponse, RequestError> A promise
Send a new device public key to the Particle Cloud
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.key
(String | Buffer) Public key contentsoptions.algorithm
String Algorithm used to generate the public key. Valid values arersa
orecc
. (optional, defaultrsa
)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Call a device function
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.name
String Function nameoptions.argument
String Function argumentoptions.product
String? Device in this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Get a stream of events
Parameters
options
Object Options for this API call
Returns Promise If the promise resolves, the resolution value will be an EventStream object that will emit 'event' events.
Publish a event to the Particle Cloud
Parameters
options
Object Options for this API calloptions.name
String Event nameoptions.data
String Event dataoptions.isPrivate
Boolean Should the event be publicly available?options.product
String? Event for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Type: Object
Parameters
$0
Object$0.event
$0.url
$0.device
$0.rejectUnauthorized
$0.noDefaults
$0.hook
$0.product
$0.auth
$0.headers
$0.context
Properties
method
String? Type of web request triggered by the Webhook (GET, POST, PUT, or DELETE)auth
Object? Auth data like{ user: 'me', pass: '1234' }
for basic auth or{ bearer: 'token' }
to send with the Webhook requestheaders
Object? Additional headers to add to the Webhook like{ 'X-ONE': '1', X-TWO: '2' }
query
Object? Query params to add to the Webhook request like{ foo: 'foo', bar: 'bar' }
json
Object? JSON data to send with the Webhook request - setsContent-Type
toapplication/json
form
Object? Form data to send with the Webhook request - setsContent-Type
toapplication/x-www-form-urlencoded
body
String? Custom body to send with the Webhook requestresponseTemplate
Object? Template to use to customize the Webhook response bodyresponseEvent
Object? The Webhook response event name that your devices can subscribe toerrorResponseEvent
Object? The Webhook error response event name that your devices can subscribe to
Create a webhook
Parameters
options
Object Options for this API calloptions.event
String The name of the Particle event that should trigger the Webhookoptions.url
String The web address that will be targeted when the Webhook is triggeredoptions.device
String? Trigger Webhook only for this device ID or Nameoptions.rejectUnauthorized
Boolean? Set tofalse
to skip SSL certificate validation of the target URLoptions.noDefaults
Boolean? Don't include default event data in the webhook requestoptions.hook
Hook? Webhook configuration settingsoptions.product
String? Webhook for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Delete a webhook
Parameters
options
Object Options for this API calloptions.hookId
String Webhook IDoptions.product
String? Webhook for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
List all webhooks owned by the account or product
Parameters
options
Object Options for this API call
Returns Promise A promise
Create an integration to send events to an external service
See the API docs for details https://docs.particle.io/reference/api/#integrations-webhooks-
Parameters
options
Object Options for this API calloptions.event
String Event that triggers the integrationoptions.settings
Object Settings specific to that integration typeoptions.deviceId
String? Trigger integration only for this device ID or Nameoptions.product
String? Integration for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Edit an integration to send events to an external service
See the API docs for details https://docs.particle.io/reference/api/#integrations-webhooks-
Parameters
options
Object Options for this API calloptions.integrationId
String The integration to editoptions.event
String? Change the event that triggers the integrationoptions.settings
Object? Change the settings specific to that integration typeoptions.deviceId
String? Trigger integration only for this device ID or Nameoptions.product
String? Integration for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Delete an integration to send events to an external service
Parameters
options
Object Options for this API calloptions.integrationId
String The integration to removeoptions.product
String? Integration for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
List all integrations owned by the account or product
Parameters
options
Object Options for this API call
Returns Promise A promise
Get details about the current user
Parameters
options
Object Options for this API call
Returns Promise A promise
Set details on the current user
Parameters
options
Object Options for this API calloptions.accountInfo
String Set user's extended info fields (name, business account, company name, etc)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Change username (i.e, email)
Parameters
options
Object Options for this API calloptions.currentPassword
String Current passwordoptions.username
String New emailoptions.invalidateTokens
Boolean Should all tokens be invalidated (optional, defaultfalse
)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Change user's password
Parameters
options
Object Options for this API calloptions.currentPassword
String Current passwordoptions.password
String New passwordoptions.invalidateTokens
Boolean Should all tokens be invalidated (optional, defaultfalse
)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
List SIM cards owned by a user or product
Parameters
options
Object Options for this API calloptions.iccid
String? (Product only) Filter to SIM cards matching this ICCIDoptions.deviceId
String? (Product only) Filter to SIM cards matching this device IDoptions.deviceName
String? (Product only) Filter to SIM cards matching this device nameoptions.page
Number? (Product only) Current page of resultsoptions.perPage
Number? (Product only) Records per pageoptions.product
String? SIM cards for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Get data usage for one SIM card for the current billing period
Parameters
options
Object Options for this API calloptions.iccid
String ICCID of the SIM cardoptions.product
String? SIM card for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Get data usage for all SIM cards in a product the current billing period
Parameters
options
Object Options for this API call
Returns Promise A promise
Check SIM status
Parameters
options
Object Options for this API call
Returns Promise A promise
Activate and add SIM cards to an account or product
Parameters
options
Object Options for this API calloptions.iccid
String ICCID of the SIM cardoptions.iccids
Array<String> (Product only) ICCID of multiple SIM cards to importoptions.country
String The ISO country code for the SIM cardsoptions.promoCode
any?options.product
String? SIM cards for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Deactivate a SIM card so it doesn't incur data usage in future months.
Parameters
options
Object Options for this API calloptions.iccid
String ICCID of the SIM cardoptions.product
String? SIM cards for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Reactivate a SIM card the was deactivated or unpause a SIM card that was automatically paused
Parameters
options
Object Options for this API calloptions.iccid
String ICCID of the SIM cardoptions.mbLimit
Number? New monthly data limit. Necessary if unpausing a SIM cardoptions.product
String? SIM cards for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Update SIM card data limit
Parameters
options
Object Options for this API calloptions.iccid
String ICCID of the SIM cardoptions.mbLimit
Array Data limit in megabyte for the SIM cardoptions.product
String? SIM cards for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Remove a SIM card from an account so it can be activated by a different account
Parameters
options
Object Options for this API calloptions.iccid
String ICCID of the SIM cardoptions.product
String? SIM cards for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
List valid build targets to be used for compiling
Parameters
options
Object Options for this API calloptions.onlyFeatured
Boolean Only list featured build targets (optional, defaultfalse
)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
List firmware libraries
Parameters
options
Object Options for this API calloptions.page
Number Page index (default, first page)options.limit
Number Number of items per pageoptions.filter
String Search term for the librariesoptions.sort
String Ordering key for the library listoptions.architectures
Array<String> List of architectures to filteroptions.category
String Category to filteroptions.scope
String The library scope to list. Default is 'all'. Other values are - 'all' - list public libraries and my private libraries - 'public' - list only public libraries - 'private' - list only my private libraries - 'mine' - list my libraries (public and private) - 'official' - list only official libraries - 'verified' - list only verified libraries - 'featured' - list only featured librariesoptions.excludeScopes
String list of scopes to excludeoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Get firmware library details
Parameters
options
Object Options for this API calloptions.name
String Name of the library to fetchoptions.version
String Version of the library to fetch (default: latest)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Firmware library details for each version
Parameters
options
Object Options for this API calloptions.name
String Name of the library to fetchoptions.page
Number Page index (default, first page)options.limit
Number Number of items per pageoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Contribute a new library version from a compressed archive
Parameters
options
Object Options for this API calloptions.archive
(String | Buffer) Compressed archive file containing the library sources Either a path or Buffer of the file contents in Node, or a File or Blob in the browser.options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Publish the latest version of a library to the public
Parameters
options
Object Options for this API call
Returns Promise A promise
Delete one version of a library or an entire private library
Parameters
options
Object Options for this API calloptions.name
String Name of the library to removeoptions.force
String Key to force deleting a public libraryoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Download an external file that may not be on the API
Parameters
options
Object Options for this API call
Returns Promise Resolves to a buffer with the file data
List OAuth client created by the account
Parameters
options
Object Options for this API call
Returns Promise A promise
Create an OAuth client
Parameters
options
Object Options for this API calloptions.name
String Name of the OAuth clientoptions.type
String web, installed or weboptions.redirect_uri
String? URL to redirect after OAuth flow. Only for type web.options.scope
Object? Limits what the access tokens created by this client can do.options.product
String? Create client for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Update an OAuth client
Parameters
options
Object Options for this API calloptions.clientId
String The OAuth client to updateoptions.name
String? New Name of the OAuth clientoptions.scope
Object? New scope of the OAuth clientoptions.product
String? Update client linked to this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Delete an OAuth client
Parameters
options
Object Options for this API calloptions.clientId
String The OAuth client to updateoptions.product
String? OAuth client linked to this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
List products the account has access to
Parameters
options
Object Options for this API call
Returns Promise A promise
Get detailed information about a product
Parameters
options
Object Options for this API call
Returns Promise A promise
List product firmware versions
Parameters
options
Object Options for this API call
Returns Promise A promise
List product firmware versions
Parameters
options
Object Options for this API calloptions.file
Object Path or Buffer of the new firmware file Either a path or Buffer of the file contents in Node, or a File or Blob in the browser.options.version
Number Version number of new firmwareoptions.title
String Short identifier for the new firmwareoptions.description
String? Longer description for the new firmwareoptions.product
String Firmware for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Get information about a product firmware version
Parameters
options
Object Options for this API calloptions.version
Number Version number of firmwareoptions.product
String Firmware for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Update information for a product firmware version
Parameters
options
Object Options for this API calloptions.version
Number Version number of new firmwareoptions.title
String? New titleoptions.description
String? New descriptionoptions.product
String Firmware for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Download a product firmware binary
Parameters
options
Object Options for this API calloptions.version
Number Version number of new firmwareoptions.product
String Firmware for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse, RequestError> A promise that resolves with either the requested data or an error object
Release a product firmware version as the default version
Parameters
options
Object Options for this API calloptions.version
Number Version number of new firmwareoptions.product
String Firmware for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
List product team members
Parameters
options
Object Options for this API call
Returns Promise A promise
Invite Particle user to a product team
Parameters
options
Object Options for this API calloptions.username
String Username for the Particle accountoptions.product
String Team for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Remove Particle user to a product team
Parameters
options
Object Options for this API calloptions.username
String Username for the Particle accountoptions.product
String Team for this product ID or slugoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Fetch details about a serial number
Parameters
options
Object Options for this API calloptions.serialNumber
String The serial number printed on the barcode of the device packagingoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Create a mesh network
Parameters
options
Object Options for this API calloptions.name
String Network nameoptions.deviceId
String Gateway device IDoptions.iccid
String? ICCID of the active SIM card (only for cellular gateway devices)options.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<Object> A promise
Remove a mesh network.
Parameters
options
Object Options for this API call
Returns Promise<Object> A promise
List all mesh networks
Parameters
options
Object Options for this API calloptions.page
Number? Current page of resultsoptions.perPage
Number? Records per pageoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<Object> A promise
Get information about a mesh network.
Parameters
options
Object Options for this API call
Returns Promise<Object> A promise
Modify a mesh network.
Parameters
options
Object Options for this API calloptions.networkId
String Network ID or nameoptions.action
String 'add-device', 'remove-device', 'gateway-enable' or 'gateway-disable'options.deviceId
String Device IDoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<Object> A promise
Add a device to a mesh network.
Parameters
options
Object Options for this API call
Returns Promise<Object> A promise
Remove a device from a mesh network.
Parameters
options
Object Options for this API call
Returns Promise<Object> A promise
List all devices of a mesh network.
Parameters
options
Object Options for this API calloptions.networkId
String Network ID or nameoptions.role
Number? Device role: 'gateway' or 'node'options.page
Number? Current page of resultsoptions.perPage
Number? Records per pageoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<Object> A promise
Get product configuration
Parameters
options
Object Options for this API call
Returns Promise A promise
Get product configuration schema
Parameters
options
Object Options for this API call
Returns Promise A promise
Get product device's configuration
Parameters
options
Object Options for this API calloptions.auth
string? The access token. Can be ignored if provided in constructoroptions.product
String Config for this product ID or slugoptions.deviceId
String Device ID to accessoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Get product device's configuration schema
Parameters
options
Object Options for this API calloptions.auth
string? The access token. Can be ignored if provided in constructoroptions.product
String Config for this product ID or slugoptions.deviceId
String Device ID to accessoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Set product configuration
Parameters
options
Object Options for this API calloptions.auth
string? The access token. Can be ignored if provided in constructoroptions.product
String Config for this product ID or slugoptions.config
Object Product configuration to updateoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Set product configuration for a specific device within the product
Parameters
options
Object Options for this API calloptions.auth
string? The access token. Can be ignored if provided in constructoroptions.product
String Config for this product ID or slugoptions.deviceId
String Device ID to accessoptions.config
Object Product configuration to updateoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Query location for devices within a product
Parameters
options
Object Options for this API calloptions.auth
string? The access token. Can be ignored if provided in constructoroptions.product
String Locations for this product ID or slugoptions.dateRange
String Start and end date in ISO8601 format, separated by comma, to queryoptions.rectBl
String Bottom left of the rectangular bounding box to query. Latitude and longitude separated by commaoptions.rectTr
String Top right of the rectangular bounding box to query. Latitude and longitude separated by commaoptions.deviceId
String Device ID prefix to include in the queryoptions.deviceName
String Device name prefix to include in the queryoptions.groups
String Array of group names to include in the queryoptions.page
String Page of results to display. Defaults to 1options.perPage
String Number of results per page. Defaults to 20. Maximum of 100options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Query location for one device within a product
Parameters
options
Object Options for this API calloptions.auth
string? The access token. Can be ignored if provided in constructoroptions.product
String Locations for this product ID or slugoptions.dateRange
String Start and end date in ISO8601 format, separated by comma, to queryoptions.rectBl
String Bottom left of the rectangular bounding box to query. Latitude and longitude separated by commaoptions.rectTr
String Top right of the rectangular bounding box to query. Latitude and longitude separated by commaoptions.deviceId
String Device ID to queryoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise A promise
Executes the provided logic function once and returns the result. No logs, runs, etc are saved
NOTE: Any external interactions such as Particle.publish will actually occur when the logic is executed.
Parameters
options
Object The options for creating the logic function.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.logic
Object The logic "function" which will be executed onceoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to the created logic function data.
Creates a new logic function in the specified organization or sandbox using the provided function data.
When you create a logic function with Event logic triggers, events will immediately start being handled by the function code.
When you create a Scheduled logic trigger, it will immediately be scheduled at the next time according to the cron and start_at properties.
Parameters
options
Object The options for creating the logic function.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.logicFunction
Object The logic function object containing the function details.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to the created logic function data.
Get a logic function in the specified organization or sandbox by logic function ID.
Parameters
options
Object The options for the logic function.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.logicFunctionId
string The ID of the logic function to retrieve.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to the specified logic function data.
Updates an existing logic function in the specified organization or sandbox using the provided function data.
If you include an id on a logic trigger, it will update the logic trigger in place.
Parameters
options
Object The options for updating the logic function.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.logicFunctionId
string The ID of the logic function to update.options.logicFunction
Object The logic function object containing the logic function details.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context.
Returns Promise<RequestResponse> A promise that resolves to the updated logic function data.
Deletes a logic function in the specified organization or sandbox by logic function ID.
Parameters
options
Object The options for deleting the logic function.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.logicFunctionId
string The ID of the logic function to delete.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context.
Returns Promise<RequestResponse> A promise that resolves to an object containing the deleted logic function ID.
Lists all logic functions in the specified organization or sandbox.
Parameters
options
Object The options for listing logic functions.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.todayStats
boolean? Whether to include today's stats in the responseoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context.
Returns Promise<RequestResponse> A promise that resolves to an array of logic functions data.
Lists all logic runs for the specified logic function in the specified organization or sandbox.
Parameters
options
Object The options for the request.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.logicFunctionId
string The ID of the logic function for which to retrieve the logic runs.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to an array of logic run data.
Retrieves a logic run by its ID for the specified logic function in the specified organization or sandbox.
Parameters
options
Object The options for the request.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.logicFunctionId
string The ID of the logic function for which to retrieve the logic run.options.logicRunId
string The ID of the logic run to retrieve.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to an array of logic run data for the specified logic run ID.
Retrieves the logs for a logic run by its ID for the specified logic function in the specified organization or sandbox.
Parameters
options
Object The options for the request.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The unique identifier of the organization.options.logicFunctionId
string The ID of the logic function for which to retrieve the logic run logs.options.logicRunId
string The ID of the logic run for which to retrieve the logs.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to the logs for the specified logic run ID.
Creates a new ledger definition in the specified organization or sandbox.
Parameters
options
Object The options for creating the ledger definition.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.ledger
object The ledger definition object.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to the created ledger definition data.
Get a ledger definition in the specified organization or sandbox by ledger name.
Parameters
options
Object The options for the ledger definition.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.ledgerName
string The ID of the ledger definition to retrieve.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to the specified ledger definition data.
Updates an existing ledger definition in the specified organization or sandbox.
Parameters
options
Object The options for updating the ledger definition.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.ledgerName
string Name of the ledger definition to update.options.ledger
object The ledger definition object.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context.
Returns Promise<RequestResponse> A promise that resolves to the updated ledger definition data.
Archives a ledger definition in the specified organization or sandbox by ledger name.
Parameters
options
Object The options for archiving the ledger definition.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.ledgerName
string Name of the ledger definition to archive.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context.
Returns Promise<RequestResponse> A promise that resolves to an object confirming the ledger definition was archived.
Type: ("Owner"
| "Product"
| "Device"
)
Parameters
$0
Object$0.auth
$0.org
$0.scope
$0.page
$0.perPage
$0.archived
$0.headers
$0.context
Lists all ledger definitions in the specified organization or sandbox.
Parameters
options
Object The options for listing ledger definitions.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.scope
Scope? Filter to show only ledgers of the specified scopeoptions.page
number? Page of results to displayoptions.perPage
number? Number of results per page. Default is 100options.archived
boolean? Filter to show only archived ledger or non-archived ledgers. If not provided, all ledgers are returned.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context.
Returns Promise<RequestResponse> A promise that resolves to an array of ledger definition data.
Get ledger instance data.
Parameters
options
Object The options for the ledger instance.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.ledgerName
string Ledger name.options.scopeValue
string Scope value.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to the specified ledger instance data.
Type: ("Replace"
| "Merge"
)
Parameters
$0
Object$0.auth
$0.org
$0.ledgerName
$0.scopeValue
$0.instance
$0.setMode
$0.headers
$0.context
Set ledger instance data.
Parameters
options
Object The options for updating the ledger instance.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.ledgerName
string Ledger name.options.scopeValue
string Scope value.options.instance
object The instance with the dataoptions.setMode
SetMode? How the data should be set with existing data. Default is "Replace"options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context.
Returns Promise<RequestResponse> A promise that resolves to the updated ledger instance data.
Delete a ledger instance in the specified organization or sandbox by ledger name.
Parameters
options
Object The options for archiving the ledger instance.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.ledgerName
string Name of the ledger instance to archive.options.scopeValue
string Scope value.options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context.
Returns Promise<RequestResponse> A promise that resolves to an object confirming the ledger instance was deleted.
Lists ledger instances in the specified organization or sandbox.
Parameters
options
Object The options for listing ledger instances.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The unique identifier of the organization.options.ledgerName
string Name of the ledger instance to archive.options.page
number? Page of results to displayoptions.perPage
number? Number of results per page. Default is 100options.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context.
Returns Promise<RequestResponse> A promise that resolves to an array of ledger instance data.
List ledger instance versions
Parameters
options
Object The options for the ledger instance.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.ledgerName
string Ledger name.options.scopeValue
string Scope value.options.replacedBefore
string? ISO date string to filter to instances replaced before this timeoptions.replacedAfter
string? ISO date string to filter to instances replaced after this timeoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to an array of ledger instance data.
Get specific ledger instance version
Parameters
options
Object The options for the ledger instance.options.auth
string? The access token. Can be ignored if provided in constructoroptions.org
string? The Organization ID or slug. If not provided, the request will go to your sandbox account.options.ledgerName
string Ledger name.options.scopeValue
string Scope value.options.version
string Version of the ledger instanceoptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to the specified ledger instance data.
List Device OS versions
Parameters
options
Object Options for this API calloptions.platformId
Number? Platform ID to filter Device OS versionsoptions.internalVersion
Number? Internal version number to filter Device OS versionsoptions.page
Number? Page number for paginationoptions.perPage
Number? Number of items per pageoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to the list of Device OS versions.
Get a specific Device OS version
Parameters
options
Object Options for this API calloptions.version
String Version of the Device OSoptions.platformId
Number? Optional platform ID to filter Device OS versionoptions.auth
string? The access token. Can be ignored if provided in constructoroptions.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.options.context
Object? Request context
Returns Promise<RequestResponse> A promise that resolves to the specified Device OS version data.
Set default auth token that will be used in each method if auth
is not provided
Parameters
Make a GET request
Parameters
params
objectparams.uri
string The URI to requestparams.auth
string? Authorization token to useparams.headers
object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.params.query
object? Key/Value pairs of query params or a correctly formatted stringparams.context
object? The invocation context, describing the tool and project
Returns Promise<RequestResponse, RequestError> A promise that resolves with either the requested data or an error object
Make a HEAD request
Parameters
params
objectparams.uri
string The URI to requestparams.auth
string? Authorization token to useparams.headers
object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.params.query
object? Key/Value pairs of query params or a correctly formatted stringparams.context
object? The invocation context, describing the tool and project
Returns Promise<RequestResponse, RequestError> A promise that resolves with either the requested data or an error object
Make a POST request
Parameters
params
objectparams.uri
string The URI to requestparams.auth
string? Authorization token to useparams.headers
object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.params.data
(string | object)? Request bodyparams.context
object? The invocation context, describing the tool and project
Returns Promise<RequestResponse, RequestError> A promise that resolves with either the requested data or an error object
Make a PUT request
Parameters
params
objectparams.uri
string The URI to requestparams.auth
string? Authorization token to useparams.headers
object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.params.data
(string | object)? Request bodyparams.query
object? Key/Value pairs of query params or a correctly formatted stringparams.context
object? The invocation context, describing the tool and project
Returns Promise<RequestResponse, RequestError> A promise that resolves with either the requested data or an error object
Make a DELETE request
Parameters
params
objectparams.uri
string The URI to requestparams.auth
string? Authorization token to useparams.headers
object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.params.data
(string | object)? Request bodyparams.context
object? The invocation context, describing the tool and project
Returns Promise<RequestResponse, RequestError> A promise that resolves with either the requested data or an error object
Parameters
args
Object An obj with all the possible request configurationsargs.uri
String The URI to requestargs.method
String The method used to request the URI, should be in uppercase.args.headers
Object? Key/Value pairs like{ 'X-FOO': 'foo', X-BAR: 'bar' }
to send as headers.args.data
object? Arbitrary data to send as the body.args.auth
string? Authorizationargs.query
Object? Query parametersargs.form
Object? Form fieldsargs.files
Object? Array of file names and file contentargs.context
Object? The invocation context, describing the tool and project.args.isBuffer
boolean? Indicate if the response should be treated as Buffer instead of JSON
Returns Promise<RequestResponse, RequestError> A promise that resolves with either the requested data or an error object