latestOpenAPI 3.0.32026-08-224982,0272.8 MB

e445c15e5bee

User

Create access token

Create an access token to use BitGo APIs. BitGo restricts access tokens in the production environment to specific IP addresses. However, access tokens in the test environment don't require an IP address restriction. If you omit a spending limit, you must unlock the token using the Unlock session endpoint on a regular basis to permit operations such as withdrawals. Therefore, BitGo recommends including a spending limit.

post/api/v2/user/accesstoken

Request body

durationnumber

The duration of the access token in seconds.

labelstring required

A label for the access token.

otpstring required

The one-time password.

adminboolean

True, if this access token has admin permissions.

adminScope'read' | 'full'

Scope for admin permissions. Defaults to 'full' when omitted.

ipRestrictstring[] nullable

Restricts the access token to use only from the provided IP addresses. Required for access tokens in the production environment. Not required for access tokens in the test environment.

enterprisestring

The enterprise ID that the user belongs to.

accessTokenTemplateIdstring

ID of the AccessTokenTemplate to use as defaults for this token.

Template fields act as defaults — they are used when the corresponding field is absent from the request body. Any value you provide in the request, including an empty array, takes precedence.

For example, if the template has scope: ['spend', 'transfer'] and you send scope: ['read'], the created token will have scope: ['read']. If you omit scope entirely, the token gets scope: ['spend', 'transfer'] from the template.

permittedEnterprisesstring[]
permittedWalletsstring[]

Example request

{
  "spendingLimits": [
    {
      "coin": "btc"
    }
  ]
}

Response

OK

idstring required
isExtensibleboolean required
adminScope'read' | 'full'
bitgoAdminPermissionsstring[]
clientstring
createdstring date-time
enterprisestring
expiresstring date-time
extensionAddressstring
ipstring ipv4

IP address of the client that requested this access token

ipRestrictstring[]
labelstring
originstring

BitGo environment that issued this token

tokenstring
scopestring[]
userstring
isMobileAccessTokenboolean

Flag indicating if this token was created via mobile session endpoint

Example response

{
  "id": "59cd72485007a239fb00282ed480da1f",
  "ip": "127.0.0.1",
  "origin": "test.bitgo.com",
  "scope": [
    "crypto_compare",
    "user_manage",
    "openid",
    "profile",
    "wallet_create",
    "wallet_manage_all",
    "wallet_approve_all",
    "wallet_spend_all",
    "wallet_edit_all",
    "wallet_view_all"
  ],
  "user": "59cd72485007a239fb00282ed480da1f"
}