Skip to main content

GET /users/:userId

Request

This route will return a user.

Request Method:

  • GET

Base URL:

  • https://api.userdocks.com

End Point:

  • /v1/users/:userId
Path Variables:
VariableTypeRequiredDescription
:userIdStringtruethe UUID or the email of the user
Query Parameters:

None

HTTP Headers:

Note: Never use API Keys on the client

Note: This endpoint can only be accessed with an API key

PropertyTypeRequiredAccessDescription
X-API-KEYStringtrueOnly access to AppApi key for the userdocks app
X-API-KEY-TYPEStringtrueOnly access to Appread
X-CLIENT-IDStringtrueOnly access to AppUUID of the userdocks app

HTTP Body:

None

Response:

  • Object

Example:

try {
// call userdocks user management API
const response = await fetch('https://api.userdocks.com/v1/users/:userId', {
method: 'GET',
headers: {
// 'Authorization': String, // when accessed from the client e.g. `Bearer ${accessToken}`
'X-API-KEY': String,
'X-CLIENT-ID': String,
'X-API-KEY-TYPE': 'read',
'Content-Type': 'application/json',
},
});
const { data } = await response.json();

// do something with the data
} catch (err) {
console.error(err);
// handle error
}

Successful Response:

Can have the following HTTP Status Codes:

  • 200 - OK
// GET /v1/users
{
"success": Boolean,
"message": String,
"error": null,
"data": {
"kind": "user",
"id": String,
"appId": String,
"language": String,
"salutation": String,
"salutationOther": String,
"acceptedNewsletter": Boolean,
"acceptedNewsletterDate": String,
"lastAskedNewsletterSignUp": String,
"mailchimpMemberId": String,
"name": String,
// open id fields use snake case
"given_name": String,
"family_name": String,
"middle_name": String,
"nickname": String,
"preferred_username": String,
"profile": String,
"picture": String,
"website": String,
"email": String,
"email_verified": Boolean,
"gender": String,
"other_gender": String,
"birthdate": String,
"zoneinfo": String,
"locale": String,
"phone_number": String,
"phone_number_verified": Boolean,
"freezed": Boolean,
"deleted": Boolean,
"tenantId": Boolean
}
}

Error Response:

Can have the following HTTP Status Codes:

  • 400 - Bad Request
  • 401 - Unauthorized
  • 403 - Forbidden
  • 500 - Internal Server Error
// GET /v1/users
{
"success": Boolean,
"error": String,
"message": null,
"data": null
}