Explore how adaptive content transforms your docs into a dynamic, tailored experience for every user.
Read the docs
LogoLogo
ProductPricingLog inSign up
  • Documentation
  • Developers
  • Guides
  • Changelog
  • Help Center
  • Getting Started
    • Developer Documentation
    • Quickstart
    • Development
    • Publishing
  • Integrations
    • Introduction
    • Using the CLI
    • Configuration
    • ContentKit
      • Component reference
    • Integration runtime
  • Client library
  • Guides
    • Creating a custom unfurl action
    • Creating interactive blocks
    • Referencing your integration in Markdown
    • Working with HTTP requests
    • Using the CLI in CI/CD
  • GitBook API
    • Introduction
    • Authentication
    • API reference
      • Organizations
        • Organization members
        • Organization invites
        • Organization AI ask
      • Docs sites
        • Site share links
        • Site structure
        • Site auth
        • Site preview
        • Site customization
        • Site spaces
        • Site sections
        • Site section groups
        • Site redirects
        • Site MCP servers
        • Site ads
        • Site users
        • Site insights
        • Site AI ask
      • Collections
        • Collection users
        • Collection teams
      • Spaces
        • Space content
        • Space comments
        • Space embeds
        • Space users
        • Space teams
        • Space integrations
        • Git
      • Change requests
        • Change request content
        • Change request contributors
        • Change request reviewers
        • Change request comments
      • Translations
        • Glossary
      • Integrations
      • URLs
      • OpenAPI
        • OpenAPI spec versions
      • Conversations
      • Custom fonts
      • Subdomains
      • Users
      • Teams
        • Team members
      • SSO
      • Storage
      • Custom hostnames
      • System info
    • Rate limiting
    • Pagination
    • Errors
  • Marketplace
    • Overview
    • Submit your app for review
  • Resources
    • Concepts
    • Changelog
    • ContentKit playground
    • GitHub examples
Powered by GitBook
On this page
  1. GitBook API
  2. API reference

Users

Retrieve and manage user information and profiles.

Was this helpful?

LogoLogo

Resources

  • Showcase
  • Enterprise
  • Status

Company

  • Careers
  • Blog
  • Community

Policies

  • Subprocessors
  • Terms of Service
CtrlK
  • The User object
  • GETGet profile of authenticated user
  • GETGet a user by its ID
  • PATCHUpdate a user by its ID

Was this helpful?

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"

Possible values:
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"
  }
}

Get profile of authenticated user

get

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"
  }
}

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
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 user by its ID

patch

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"
  }
}