Users
User Resource
Generic user information. By default, only public information is shared without any scopes. More detailed information or email can be requested with additional scopes.
Parameter | Description |
---|---|
id string | Resource ID |
name string, optional | User's public name |
username string, optional | Payment method's native currency |
profile_location string, optional | Location for user's public profile |
profile_bio string, optional | Bio for user's public profile |
profile_url string, optional | Public profile location if user has one |
avatar_url string | User's avatar url |
resource string, constant user | |
resource_path string |
User's public information (default)
{
"id": "9da7a204-544e-5fd1-9a12-61176c5d4cd8",
"name": "User One",
"username": "user1",
"profile_location": null,
"profile_bio": null,
"profile_url": "https://coinbase.com/user1",
"avatar_url": "https://images.coinbase.com/avatar?h=vR%2FY8igBoPwuwGren5JMwvDNGpURAY%2F0nRIOgH%2FY2Qh%2BQ6nomR3qusA%2Bh6o2%0Af9rH&s=128",
"resource": "user",
"resource_path": "/v2/user"
}
Detailed information of the authenticated user (wallet:user:read permission)
{
...
"time_zone": "Pacific Time (US & Canada)",
"native_currency": "USD",
"bitcoin_unit": "bits",
"country": {
"code": "US",
"name": "United States"
},
"created_at": "2015-01-31T20:49:02Z"
}
Authenticated user with their email (wallet:user:email permission)
{
...
"email": "user1@example.com"
}
Show a User
Get any user's public information with their ID.
HTTP Request
GET https://api.coinbase.com/v2/users/:user_id
Scopes
- No permission required
Example request
curl https://api.coinbase.com/v2/users/9da7a204-544e-5fd1-9a12-61176c5d4cd8 /
-H 'Authorization: Bearer abd90df5f27a7b170cd775abf89d632b350b7c1c9d53e08b340cd9832ce52c2c'
require 'coinbase/wallet'
client = Coinbase::Wallet::Client.new(api_key: <api key>, api_secret: <api secret>)
user = client.user("9da7a204-544e-5fd1-9a12-61176c5d4cd8")
from coinbase.wallet.client import Client
client = Client(<api_key>, <api_secret>)
user = client.get_user("9da7a204-544e-5fd1-9a12-61176c5d4cd8")
var Client = require('coinbase').Client;
var client = new Client({'apiKey': 'API KEY',
'apiSecret': 'API SECRET'});
client.getUser('9da7a204-544e-5fd1-9a12-61176c5d4cd8', function(err, user) {
console.log(user);
});
Example response (200)
{
"data": {
"id": "9da7a204-544e-5fd1-9a12-61176c5d4cd8",
"name": "User One",
"username": "user1",
"profile_location": null,
"profile_bio": null,
"profile_url": "https://coinbase.com/user1",
"avatar_url": "https://images.coinbase.com/avatar?h=vR%2FY8igBoPwuwGren5JMwvDNGpURAY%2F0nRIOgH%2FY2Qh%2BQ6nomR3qusA%2Bh6o2%0Af9rH&s=128",
"resource": "user",
"resource_path": "/v2/user/9da7a204-544e-5fd1-9a12-61176c5d4cd8"
}
}
Show Current User
Get current user's public information. To get user's email or private information, use permissions wallet:user:email
and wallet:user:read
. If current request has a wallet:transactions:send
scope, then the response will contain a boolean sends_disabled
field that indicates if the user's send functionality has been disabled.
HTTP Request
GET https://api.coinbase.com/v2/user
Scopes
- No scope required for public data
wallet:user:read
wallet:user:email
Example request
curl https://api.coinbase.com/v2/user /
-H 'Authorization: Bearer abd90df5f27a7b170cd775abf89d632b350b7c1c9d53e08b340cd9832ce52c2c'
require 'coinbase/wallet'
client = Coinbase::Wallet::Client.new(api_key: <api key>, api_secret: <api secret>)
user = client.current_user
from coinbase.wallet.client import Client
client = Client(<api_key>, <api_secret>)
user = client.get_current_user()
var Client = require('coinbase').Client;
var client = new Client({'apiKey': 'API KEY',
'apiSecret': 'API SECRET'});
client.getCurrentUser(function(err, user) {
console.log(user);
});
Example response
{
"data": {
"id": "9da7a204-544e-5fd1-9a12-61176c5d4cd8",
"name": "User One",
"username": "user1",
"profile_location": null,
"profile_bio": null,
"profile_url": "https://coinbase.com/user1",
"avatar_url": "https://images.coinbase.com/avatar?h=vR%2FY8igBoPwuwGren5JMwvDNGpURAY%2F0nRIOgH%2FY2Qh%2BQ6nomR3qusA%2Bh6o2%0Af9rH&s=128",
"resource": "user",
"resource_path": "/v2/user"
}
}
Show Authorization Information
Get current user's authorization information including granted scopes and send limits when using OAuth2 authentication.
HTTP Request
GET https://api.coinbase.com/v2/user/auth
Scopes
- No permission required
Example request
curl https://api.coinbase.com/v2/user/auth /
-H 'Authorization: Bearer abd90df5f27a7b170cd775abf89d632b350b7c1c9d53e08b340cd9832ce52c2c'
require 'coinbase/wallet'
client = Coinbase::Wallet::Client.new(api_key: <api key>, api_secret: <api secret>)
client.auth_info
from coinbase.wallet.client import Client
client = Client(<api_key>, <api_secret>)
user = client.get_auth_info()
var Client = require('coinbase').Client;
var client = new Client({'apiKey': 'API KEY',
'apiSecret': 'API SECRET'});
client.getCurrentUser(function(err, user) {
user.showAuth(function(err, auth) {
console.log(auth);
});
});
Example response
{
"data": {
"method": "oauth",
"scopes": [
"wallet:user:read",
"wallet:user:email"
],
"oauth_meta": {}
}
}
Update Current User
Modify current user and their preferences.
HTTP Request
PUT https://api.coinbase.com/v2/user
Scopes
wallet:user:update
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
name | string | Optional | User's public name |
time_zone | string | Optional | Time zone |
native_currency | string | Optional | Local currency used to display amounts converted from BTC |
Example request
curl https://api.coinbase.com/v2/user /
-X PUT \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer abd90df5f27a7b170cd775abf89d632b350b7c1c9d53e08b340cd9832ce52c2c' \
-d '{"name": "James Smith"}'
require 'coinbase/wallet'
client = Coinbase::Wallet::Client.new(api_key: <api key>, api_secret: <api secret>)
user = client.update_current_user({name: 'James Smith'})
from coinbase.wallet.client import Client
client = Client(<api_key>, <api_secret>)
user = client.update_current_user(name='James Smith')
var Client = require('coinbase').Client;
var client = new Client({'apiKey': 'API KEY',
'apiSecret': 'API SECRET'});
client.getCurrentUser(function(err, user) {
user.update({'name': 'James Smith'}, function(err, usr) {
console.log(usr);
});
});
Response (200)
{
"data": {
"id": "9da7a204-544e-5fd1-9a12-61176c5d4cd8",
"name": "James Smith",
"username": "user1",
"profile_location": null,
"profile_bio": null,
"profile_url": "https://coinbase.com/user1",
"avatar_url": "https://images.coinbase.com/avatar?h=vR%2FY8igBoPwuwGren5JMwvDNGpURAY%2F0nRIOgH%2FY2Qh%2BQ6nomR3qusA%2Bh6o2%0Af9rH&s=128",
"resource": "user",
"resource_path": "/v2/user"
}
}