Members

A member in GitBook is the entity of a user associated with an organization.

GET members in an organization

List organization members

Lists members for the specified organization.

GEThttps://api.gitbook.com/v1/orgs/{organizationId}/members
Authorization
Path parameters
organizationId*string

The unique id of the organization

Query parameters
Response

OK

Body
nextobject
countnumber

Total count of objects in the list

items*array of OrganizationMember (object)
Request
const response = await fetch('https://api.gitbook.com/v1/orgs/{organizationId}/members', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
{
  "next": {
    "page": "text"
  },
  "count": 0,
  "items": [
    {
      "object": "member",
      "id": "text",
      "role": "admin",
      "user": {
        "object": "user",
        "id": "text",
        "displayName": "text",
        "email": "text",
        "photoURL": "text",
        "urls": {
          "location": "https://example.com"
        }
      },
      "disabled": false,
      "joinedAt": "2025-01-15T11:41:57.416Z",
      "lastSeenAt": "2025-01-15T11:41:57.416Z",
      "sso": false,
      "spaces": 0,
      "teams": 0
    }
  ]
}

GET a specific member in an organization

Get specified organization member

Gets a specific member in an organization.

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

The unique id of the organization

userId*string

The unique ID of the User

Response

OK

Body
object*enum

Type of Object, always equals to "member"

member
id*string

Unique identifier for the user.

role*MemberRoleOrGuest (one of)

The role of a member in an organization, null for guests

user*User (object)
disabled*boolean

Whatever the membership of this user is disabled and prevent them from accessing content.

joinedAt*Timestamp (string (date-time))
lastSeenAtTimestamp (string (date-time))
sso*boolean

Whether the user can login with SSO.

spaces*number
teams*number
Request
const response = await fetch('https://api.gitbook.com/v1/orgs/{organizationId}/members/{userId}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
{
  "object": "member",
  "id": "text",
  "role": "admin",
  "user": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "disabled": false,
  "joinedAt": "2025-01-15T11:41:57.416Z",
  "lastSeenAt": "2025-01-15T11:41:57.416Z",
  "sso": false,
  "spaces": 0,
  "teams": 0
}

PATCH a specific member in an organization

Update specified organization member

Updates a specific member in an organization.

PATCHhttps://api.gitbook.com/v1/orgs/{organizationId}/members/{userId}
Authorization
Path parameters
organizationId*string

The unique id of the organization

userId*string

The unique ID of the User

Body
roleMemberRoleOrGuest (one of)

The role of a member in an organization, null for guests

Response

The member has been updated

Body
object*enum

Type of Object, always equals to "member"

member
id*string

Unique identifier for the user.

role*MemberRoleOrGuest (one of)

The role of a member in an organization, null for guests

user*User (object)
disabled*boolean

Whatever the membership of this user is disabled and prevent them from accessing content.

joinedAt*Timestamp (string (date-time))
lastSeenAtTimestamp (string (date-time))
sso*boolean

Whether the user can login with SSO.

spaces*number
teams*number
Request
const response = await fetch('https://api.gitbook.com/v1/orgs/{organizationId}/members/{userId}', {
    method: 'PATCH',
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "object": "member",
  "id": "text",
  "role": "admin",
  "user": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "disabled": false,
  "joinedAt": "2025-01-15T11:41:57.416Z",
  "lastSeenAt": "2025-01-15T11:41:57.416Z",
  "sso": false,
  "spaces": 0,
  "teams": 0
}

DELETE a specific member in an organization

Delete a member from an organization

Deletes a specific member from an organization

DELETEhttps://api.gitbook.com/v1/orgs/{organizationId}/members/{userId}
Authorization
Path parameters
organizationId*string

The unique id of the organization

userId*string

The unique ID of the User

Response

The member was deleted from the organization.

Request
const response = await fetch('https://api.gitbook.com/v1/orgs/{organizationId}/members/{userId}', {
    method: 'DELETE',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
{
  "error": {
    "code": 0,
    "message": "text"
  }
}

POST a user as an SSO member in an organization

Set a user as an SSO member of an organization

POSThttps://api.gitbook.com/v1/orgs/{organizationId}/members/{userId}/sso
Authorization
Path parameters
organizationId*string

The unique id of the organization

userId*string

The unique ID of the User

Response

The user has been added as an SSO member of the organization.

Body
object*enum

Type of Object, always equals to "member"

member
id*string

Unique identifier for the user.

role*MemberRoleOrGuest (one of)

The role of a member in an organization, null for guests

user*User (object)
disabled*boolean

Whatever the membership of this user is disabled and prevent them from accessing content.

joinedAt*Timestamp (string (date-time))
lastSeenAtTimestamp (string (date-time))
sso*boolean

Whether the user can login with SSO.

spaces*number
teams*number
Request
const response = await fetch('https://api.gitbook.com/v1/orgs/{organizationId}/members/{userId}/sso', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
{
  "object": "member",
  "id": "text",
  "role": "admin",
  "user": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "disabled": false,
  "joinedAt": "2025-01-15T11:41:57.416Z",
  "lastSeenAt": "2025-01-15T11:41:57.416Z",
  "sso": false,
  "spaces": 0,
  "teams": 0
}

Last updated