User#

DoltHub provides a user API for retrieving information about the authenticated user.

Note: Please make sure to send your requests to https://www.dolthub.com instead of https://dolthub.com.

Get current user#

Here’s an example of how to fetch information about the authenticated user using an authorization token.

This endpoint requires authentication, so you must include this authorization header in your request. See the Authentication section for more details.

headers = {
    'authorization': 'token [api token you created]'
}
GET /user

Get current user

Returns information about the authenticated user, including their username, display name, profile picture, and email addresses.

URL https://www.dolthub.com/api/v1alpha1/user
Responses
200 Success

Body — application/json

{
  "status": "Success",
  "username": "jdoe",
  "display_name": "Jane Doe",
  "bio": "",
  "location": "San Francisco, CA",
  "url": "https://example.com",
  "profile_picture_url": "https://dolthubapi.../profilePictures/users/jdoe/profilePic",
  "email_addresses": [
    {
      "address": "jdoe@dolthub.com",
      "is_primary": true,
      "is_verified": true
    }
  ]
}
FieldTypeDescription
statusstringStatus of the request.
usernamestringThe user's unique handle.
display_namestringThe user's display name, or empty string if not set.
biostringThe user's bio, or empty string if not set.
locationstringThe user's location, or empty string if not set.
urlstringThe user's website URL, or empty string if not set.
profile_picture_urlstringURL of the user's profile picture.
email_addressesarray<object>Email addresses associated with the user. At least one will be primary.
401 Not authenticated. The request did not include a valid API token.

Body — application/json

{
  "status": "Error",
  "message": "Not authenticated"
}
FieldTypeDescription
statusstring
messagestring