Users
Retrieve and manage user information and profiles.
The Users API allows you to fetch data about GitBook users, including the authenticated account or other team members by ID. This is crucial for customizing permissions, personalizing content, or establishing user-specific flows.
Attributes
objectstring · enumRequiredPossible values:
Type of Object, always equals to "user"
idstringRequired
Unique identifier for the user
displayNamestringRequired
Full name for the user
emailstringOptional
Email address of the user
photoURLstringOptional
URL of the user's profile picture
The User object
{
"object": "user",
"id": "text",
"displayName": "text",
"email": "text",
"photoURL": "text",
"urls": {
"location": "https://example.com"
}
}
Returns details about the user associated with the authentication provided in the request's authorization header.
Authorizations
Responses
200
OK
application/json
404
User not found
application/json
get
GET /v1/user HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "user",
"id": "text",
"displayName": "text",
"email": "text",
"photoURL": "text",
"urls": {
"location": "https://example.com"
}
}
Provides publicly available information about someone with a GitBook account.
Authorizations
Path parameters
userIdstringRequired
The unique ID of the User
Responses
200
OK
application/json
404
User not found
application/json
get
GET /v1/users/{userId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"object": "user",
"id": "text",
"displayName": "text",
"email": "text",
"photoURL": "text",
"urls": {
"location": "https://example.com"
}
}
Update a GitBook account's details.
Authorizations
Path parameters
userIdstringRequired
The unique ID of the User
Body
displayNamestring · min: 1 · max: 64Optional
Full name for the user
photoURLstring · uri · max: 2048Optional
Responses
200
The user has been updated
application/json
404
User not found
application/json
patch
PATCH /v1/users/{userId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 55
{
"displayName": "text",
"photoURL": "https://example.com"
}
{
"object": "user",
"id": "text",
"displayName": "text",
"email": "text",
"photoURL": "text",
"urls": {
"location": "https://example.com"
}
}
Was this helpful?