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
  • 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
    • Receiving webhook notifications
  • 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
      • Imports
      • 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

Collections

Organize and manage grouped sets of spaces for better content structure.

Last updated 1 day ago

Was this helpful?

LogoLogo

Resources

  • Showcase
  • Enterprise
  • Status

Company

  • Careers
  • Blog
  • Community

Policies

  • Subprocessors
  • Terms of Service
CtrlK
  • The Collection object
  • GETGet a collection by its ID
  • DELETEDelete a collection
  • PATCHUpdate a collection
  • GETList all collection spaces
  • POSTMove a collection to a new position.
  • POSTTransfer a collection
  • GETList all collections
  • POSTCreate a collection

Was this helpful?

Collections let you bundle multiple spaces under a unified entity, making large-scale content easier to handle. You can sort content by subject, department, or any grouping logic.

The Collection object

Attributes
objectstring · enumRequired

Type of Object, always equals to "collection"

Possible values:
idstringRequired

Unique identifier for the collection

titlestring · max: 50Required

Title of the collection

descriptionstring · max: 100Optional

Description of the collection

organizationstringRequired

ID of the organization owning this collection

parentstringOptional

ID of the parent collection, if any

defaultLevelone ofRequired

Default level for a piece of content

string · enum | nullableOptional

"The role of a member in an organization. "admin": Can administrate the content: create, delete spaces, ... "create": Can create content. "review": Can review content. "edit": Can edit the content (live or change requests). "comment": Can access the content and its discussions. "read": Can access the content, but cannot update it in any way.

Possible values:

The Collection object

{
  "object": "collection",
  "id": "text",
  "title": "text",
  "description": "text",
  "organization": "text",
  "parent": "text",
  "defaultLevel": "admin",
  "urls": {
    "location": "https://example.com",
    "app": "https://example.com"
  },
  "permissions": {
    "view": true,
    "admin": true,
    "viewInviteLinks": true,
    "create": true
  }
}

Get a collection by its ID

get
Authorizations
Path parameters
collectionIdstringRequired

The unique id of the collection

Responses
200

OK

application/json
get
GET /v1/collections/{collectionId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "object": "collection",
  "id": "text",
  "title": "text",
  "description": "text",
  "organization": "text",
  "parent": "text",
  "defaultLevel": "admin",
  "urls": {
    "location": "https://example.com",
    "app": "https://example.com"
  },
  "permissions": {
    "view": true,
    "admin": true,
    "viewInviteLinks": true,
    "create": true
  }
}

Delete a collection

delete
Authorizations
Path parameters
collectionIdstringRequired

The unique id of the collection

Responses
204

Collection did not exist

205

Collection has been deleted

delete
DELETE /v1/collections/{collectionId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Update a collection

patch
Authorizations
Path parameters
collectionIdstringRequired

The unique id of the collection

Body
titlestring · max: 50Optional

Title of the collection

descriptionstring · max: 100Optional

Description of the collection

defaultLevelone ofOptional

Default level for a piece of content

string · enum | nullableOptional

"The role of a member in an organization. "admin": Can administrate the content: create, delete spaces, ... "create": Can create content. "review": Can review content. "edit": Can edit the content (live or change requests). "comment": Can access the content and its discussions. "read": Can access the content, but cannot update it in any way.

Possible values:
Responses
200

The collection has been updated

application/json
patch
PATCH /v1/collections/{collectionId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 60

{
  "title": "text",
  "description": "text",
  "defaultLevel": "admin"
}
200

The collection has been updated

{
  "object": "collection",
  "id": "text",
  "title": "text",
  "description": "text",
  "organization": "text",
  "parent": "text",
  "defaultLevel": "admin",
  "urls": {
    "location": "https://example.com",
    "app": "https://example.com"
  },
  "permissions": {
    "view": true,
    "admin": true,
    "viewInviteLinks": true,
    "create": true
  }
}

List all collection spaces

get
Authorizations
Path parameters
collectionIdstringRequired

The unique id of the collection

Query parameters
pagestringOptional

Identifier of the page results to fetch.

limitnumber · max: 1000Optional

The number of results per page

Responses
200

OK

application/json
Responseall of
get
GET /v1/collections/{collectionId}/spaces HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "next": {
    "page": "text"
  },
  "count": 1,
  "items": [
    {
      "object": "space",
      "id": "text",
      "title": "text",
      "emoji": "🎉",
      "visibility": "public",
      "createdAt": "2025-10-24T19:46:06.132Z",
      "updatedAt": "2025-10-24T19:46:06.132Z",
      "deletedAt": "2025-10-24T19:46:06.132Z",
      "editMode": "live",
      "mergeRules": {
        "type": "inherit"
      },
      "urls": {
        "location": "https://example.com",
        "app": "https://example.com",
        "published": "https://example.com",
        "public": "https://example.com",
        "icon": "https://example.com"
      },
      "organization": "text",
      "parent": "text",
      "language": "en",
      "gitSync": {
        "repoName": "text",
        "installationProvider": "github",
        "integration": "text",
        "url": "text",
        "updatedAt": "2025-10-24T19:46:06.132Z"
      },
      "visitorAuth": {
        "backend": "custom"
      },
      "revision": "text",
      "defaultLevel": "admin",
      "comments": 1,
      "changeRequests": 1,
      "changeRequestsOpen": 1,
      "changeRequestsDraft": 1,
      "permissions": {
        "view": true,
        "access": true,
        "admin": true,
        "viewInviteLinks": true,
        "edit": true,
        "triggerGitSync": true,
        "comment": true,
        "merge": true,
        "review": true,
        "installIntegration": true
      }
    }
  ]
}

Move a collection to a new position.

post
Authorizations
Path parameters
collectionIdstringRequired

The unique id of the collection

Body
parentstring | nullableOptional

The unique id of the parent collection

Responses
200

Collection moved

application/json
400

Invalid position space or collection provided

application/json
404

No matching Collection found for given ID

application/json
409

Operation would not result in any update

application/json
post
POST /v1/collections/{collectionId}/move HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 111

{
  "parent": "text",
  "position": {
    "before": {
      "type": "space",
      "space": "text"
    },
    "after": {
      "type": "space",
      "space": "text"
    }
  }
}
{
  "object": "collection",
  "id": "text",
  "title": "text",
  "description": "text",
  "organization": "text",
  "parent": "text",
  "defaultLevel": "admin",
  "urls": {
    "location": "https://example.com",
    "app": "https://example.com"
  },
  "permissions": {
    "view": true,
    "admin": true,
    "viewInviteLinks": true,
    "create": true
  }
}

Transfer a collection

post
Authorizations
Path parameters
collectionIdstringRequired

The unique id of the collection

Body
organizationstringRequired

The unique id of the target organization

Responses
200

Collection transferred

application/json
404

No matching Collection found for given ID

application/json
409

Transfer would not result in any update

application/json
412

The collection cannot be moved.

application/json
post
POST /v1/collections/{collectionId}/transfer HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 23

{
  "organization": "text"
}
{
  "object": "collection",
  "id": "text",
  "title": "text",
  "description": "text",
  "organization": "text",
  "parent": "text",
  "defaultLevel": "admin",
  "urls": {
    "location": "https://example.com",
    "app": "https://example.com"
  },
  "permissions": {
    "view": true,
    "admin": true,
    "viewInviteLinks": true,
    "create": true
  }
}

List all collections

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

Query parameters
pagestringOptional

Identifier of the page results to fetch.

limitnumber · max: 1000Optional

The number of results per page

nestedbooleanOptional

If true, all nested collections will be listed

Default: true
Responses
200

OK

application/json
Responseall of
get
GET /v1/orgs/{organizationId}/collections HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "next": {
    "page": "text"
  },
  "count": 1,
  "items": [
    {
      "object": "collection",
      "id": "text",
      "title": "text",
      "description": "text",
      "organization": "text",
      "parent": "text",
      "defaultLevel": "admin",
      "urls": {
        "location": "https://example.com",
        "app": "https://example.com"
      },
      "permissions": {
        "view": true,
        "admin": true,
        "viewInviteLinks": true,
        "create": true
      }
    }
  ]
}

Create a collection

post
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

Body
titlestring · max: 50Optional
parentstringOptional

ID of a parent collection

Responses
201

Collection created

application/json
post
POST /v1/orgs/{organizationId}/collections HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 32

{
  "title": "text",
  "parent": "text"
}
201

Collection created

{
  "object": "collection",
  "id": "text",
  "title": "text",
  "description": "text",
  "organization": "text",
  "parent": "text",
  "defaultLevel": "admin",
  "urls": {
    "location": "https://example.com",
    "app": "https://example.com"
  },
  "permissions": {
    "view": true,
    "admin": true,
    "viewInviteLinks": true,
    "create": true
  }
}