Users

A user in GitBook is the entity of someone who has signed up with an account.

GET current user

Get profile of authenticated user

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

GEThttps://api.gitbook.com/v1/user
Authorization
Response

OK

Body
object*enum

Type of Object, always equals to "user"

user
id*string

Unique identifier for the user

displayName*string

Full name for the user

emailstring

Email address of the user

photoURLstring

URL of the user's profile picture

urls*object

URLs associated with the object

Request
const response = await fetch('https://api.gitbook.com/v1/user', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
{
  "object": "user",
  "id": "text",
  "displayName": "text",
  "email": "text",
  "photoURL": "text",
  "urls": {
    "location": "https://example.com"
  }
}

GET user by ID

Get a user by its ID

Provides publicly available information about someone with a GitBook account.

GEThttps://api.gitbook.com/v1/users/{userId}
Authorization
Path parameters
userId*string

The unique ID of the User

Response

OK

Body
object*enum

Type of Object, always equals to "user"

user
id*string

Unique identifier for the user

displayName*string

Full name for the user

emailstring

Email address of the user

photoURLstring

URL of the user's profile picture

urls*object

URLs associated with the object

Request
const response = await fetch('https://api.gitbook.com/v1/users/{userId}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
{
  "object": "user",
  "id": "text",
  "displayName": "text",
  "email": "text",
  "photoURL": "text",
  "urls": {
    "location": "https://example.com"
  }
}

Last updated