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.cominstead ofhttps://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/userResponses
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
}
]
}
| Field | Type | Description |
|---|---|---|
status | string | Status of the request. |
username | string | The user's unique handle. |
display_name | string | The user's display name, or empty string if not set. |
bio | string | The user's bio, or empty string if not set. |
location | string | The user's location, or empty string if not set. |
url | string | The user's website URL, or empty string if not set. |
profile_picture_url | string | URL of the user's profile picture. |
email_addresses | array<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"
}
| Field | Type | Description |
|---|---|---|
status | string | |
message | string |