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.

The User object

Attributes
objectstring · enumrequired

Type of Object, always equals to "user"

Available options:
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

urlsobjectrequired

URLs associated with the object

The User object

{
  "object": "user",
  "id": "text",
  "displayName": "text",
  "email": "text",
  "photoURL": "text",
  "urls": {
    "location": "https://example.com"
  }
}

Get profile of authenticated user

get

Returns details about the user associated with the authentication provided in the request's authorization header.

Authorizations
Responses
get
curl -L \
  --url 'https://api.gitbook.com/v1/user' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "object": "user",
  "id": "text",
  "displayName": "text",
  "email": "text",
  "photoURL": "text",
  "urls": {
    "location": "https://example.com"
  }
}

Get a user by its ID

get

Provides publicly available information about someone with a GitBook account.

Authorizations
Path parameters
userIdstringrequired

The unique ID of the User

Responses
get
curl -L \
  --url 'https://api.gitbook.com/v1/users/{userId}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "object": "user",
  "id": "text",
  "displayName": "text",
  "email": "text",
  "photoURL": "text",
  "urls": {
    "location": "https://example.com"
  }
}

Was this helpful?