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
  3. Docs sites

Site share links

Control how you share docs externally by managing share links for a site.

Was this helpful?

LogoLogo

Resources

  • Showcase
  • Enterprise
  • Status

Company

  • Careers
  • Blog
  • Community

Policies

  • Subprocessors
  • Terms of Service
CtrlK
  • The ShareLink object
  • GETList all share links
  • POSTCreate a share link
  • DELETEDeletes a share link
  • PATCHUpdate a share link

Was this helpful?

Manage the lifecycle of share links for your published sites. This includes generating new links for external sharing and revoking or updating existing ones.

The ShareLink object

Attributes
objectstring · enumRequired

Type of Object, always equals to "share-link"

Possible values:
idstringRequired

Unique identifier for the share-link

createdAtstring · date-timeRequired
namestring · max: 50Optional

Name of the share link

activebooleanOptional

The ShareLink object

{
  "object": "share-link",
  "id": "text",
  "createdAt": "2025-08-26T23:19:07.272Z",
  "name": "text",
  "active": true,
  "urls": {
    "published": "https://example.com"
  }
}

List all share links

get
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

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/orgs/{organizationId}/sites/{siteId}/share-links HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "next": {
    "page": "text"
  },
  "count": 1,
  "items": [
    {
      "object": "share-link",
      "id": "text",
      "createdAt": "2025-08-26T23:19:07.272Z",
      "name": "text",
      "active": true,
      "urls": {
        "published": "https://example.com"
      }
    }
  ]
}

Create a share link

post
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

Body
namestring · max: 50Required

Name of the share link

Responses
201

The share link has been created

application/json
post
POST /v1/orgs/{organizationId}/sites/{siteId}/share-links HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "name": "text"
}
201

The share link has been created

{
  "object": "share-link",
  "id": "text",
  "createdAt": "2025-08-26T23:19:07.272Z",
  "name": "text",
  "active": true,
  "urls": {
    "published": "https://example.com"
  }
}

Deletes a share link

delete
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

shareLinkIdstringRequired

The unique id of the share link

Responses
204

Site share link did not exist

205

Site share link has been deleted

delete
DELETE /v1/orgs/{organizationId}/sites/{siteId}/share-links/{shareLinkId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Update a share link

patch
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

shareLinkIdstringRequired

The unique id of the share link

Body
activebooleanOptional
namestring · max: 50Optional

Name of the share link

Responses
200

The site share link has been updated

application/json
patch
PATCH /v1/orgs/{organizationId}/sites/{siteId}/share-links/{shareLinkId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "active": true,
  "name": "text"
}
200

The site share link has been updated

{
  "object": "share-link",
  "id": "text",
  "createdAt": "2025-08-26T23:19:07.272Z",
  "name": "text",
  "active": true,
  "urls": {
    "published": "https://example.com"
  }
}