Site share links

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

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

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-11-07T00:25:34.759Z",
  "name": "text",
  "active": true,
  "urls": {
    "published": "https://example.com"
  }
}
get
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
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
/orgs/{organizationId}/sites/{siteId}/share-links
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-11-07T00:25:34.759Z",
      "name": "text",
      "active": true,
      "urls": {
        "published": "https://example.com"
      }
    }
  ]
}

Create a share link

post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
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
post
/orgs/{organizationId}/sites/{siteId}/share-links
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-11-07T00:25:34.759Z",
  "name": "text",
  "active": true,
  "urls": {
    "published": "https://example.com"
  }
}
delete
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
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
delete
/orgs/{organizationId}/sites/{siteId}/share-links/{shareLinkId}
DELETE /v1/orgs/{organizationId}/sites/{siteId}/share-links/{shareLinkId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

patch
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
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
/orgs/{organizationId}/sites/{siteId}/share-links/{shareLinkId}
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-11-07T00:25:34.759Z",
  "name": "text",
  "active": true,
  "urls": {
    "published": "https://example.com"
  }
}

Last updated

Was this helpful?