Overview

OpenAPI 3.0 Specification

You can download the BitGo OpenAPI 3.0 specification and run it in tools like Swagger UI or Postman. This enables you to quickly explore the BitGo API and try out requests.

Rate Limiting

BitGo enables the following default rate limits for API requests. You can request higher limits by contacting [email protected].

Request TypeWindow Size (in Seconds)Max Number of Requests per Window
Authenticated user60360
Login30015
2FA operations315
Custom API endpointsVaries1200
OAuth authorizations6060
Signup6008
IP address verification6008
Forgot password36003
Send OTP603
Get user60060
Get user sharing key3005
XRP wallet creation30050
ETH wallet creation30050
EOS wallet creation30010
ETH address creation3600500
JSON payment-protocol operations (deprecated)      30030
Generate Lightning deposit address103600
Generate Lightning deposit address (daily basis)5086400
Create Lightning invoice300300
Create Lightning invoice (daily basis)1000086400

HTTP Status Codes

The BitGo API returns the following HTTP status codes:

HTTP Status      MeaningDescription
200SuccessThe operation succeeded.
201CreatedA new object was created.
202AcceptedThe operation succeeded, but requires approval (e.g., initiating a withdrawal).
206Partial ContentThe server is delivering only part of the resource.
400Bad RequestThe client request is invalid.
401UnauthorizedAuthentication failed (e.g., invalid token specified by the Authorization header).
403ForbiddenAuthentication failed, but the operation is not allowed.
404Not FoundRequested resource does not exist.
429Too Many Requests      Client request rate exceeded the limit.

Error Handling

For REST endpoints (but not Express endpoints), when the server returns a 4xx status code, the response body contains an error object with the following structure:

{
  "error": "invalid wallet id",
  "name": "InvalidWalletId",
  "requestId": "cjo7uw7si0buzttlmazmvthay"
}

The value for the name response field doesn't change, so you can use it as an error code. The value for the error response field is a human-readable message which may change.

Pagination

Certain routes, such as listing wallets or transactions, may return an array of results and require pagination.

By default, the API returns 25 results per request. The limit parameter can be used to increase the number of results per request, up to a maximum of 500.

To get the next batch of results, call the same route again with a prevId request parameter corresponding to the nextBatchPrevId property received in the last call.

bitgo
  .coin('tbtc4')
  .wallets()
  .list({ limit: 50 })
  .then(function (wallets) {
    // print wallet list
    console.dir(wallets);
  });
curl \
-H "Authorization: Bearer $ACCESS_TOKEN" \
https://app.bitgo-test.com/api/v2/tbtc4/wallet?limit=50

Example JSON Response:

{
  "coin": "tbtc4",
  "wallets": [
    {
      "_wallet": {
        "id": "585a0860c5a04c696edd2c331ce2f346",
        "coin": "tbtc4",
        "label": "V2 TBTC4 Test Wallet",
        ...
      }
    },
    ...
  ],
  "count": 50,
  "nextBatchPrevId": "590b73478c8fc40727b0c3d421ec909c"
}

Balance Strings

For most digital assets, the wallet, transaction, and address objects have balance properties that return an integer value. But some assets have ranges that exceed values that can be stored as a typical number in JavaScript.

In BitGo Platform V2, balance properties with a string data type were added for all digital assets (and have the suffix, String). BitGo recommends that you use string balances for all assets (and not number) to ensure values do not exceed the programmable number limit.

IntegerString (recommended)
balancebalanceString
confirmedBalanceconfirmedBalanceString
spendableBalancespendableBalanceString