Spaces
A space in GitBook is the entity of a project you work in.
The unique id of the space
For sites published via share-links, the share key is useful to resolve published URLs.
OK
GET /v1/spaces/{spaceId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"object": "space",
"id": "text",
"title": "text",
"emoji": "๐",
"visibility": "public",
"createdAt": "2025-11-06T14:38:24.382Z",
"updatedAt": "2025-11-06T14:38:24.382Z",
"deletedAt": "2025-11-06T14:38:24.382Z",
"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-11-06T14:38:24.382Z"
},
"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
}
}The unique id of the space
Identifier of the page results to fetch.
The number of results per page
"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.
Listing of users who can access the space.
GET /v1/spaces/{spaceId}/permissions/aggregate HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Listing of users who can access the space.
{
"next": {
"page": "text"
},
"count": 1,
"items": [
{
"permission": "admin",
"user": {
"object": "user",
"id": "text",
"displayName": "text",
"email": "text",
"photoURL": "text",
"urls": {
"location": "https://example.com"
}
}
}
]
}The unique id of the organization
Space created
POST /v1/orgs/{organizationId}/spaces HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 118
{
"title": "text",
"emoji": "๐",
"parent": "text",
"language": "en",
"editMode": "live",
"ANY_ADDITIONAL_PROPERTY": "anything"
}Space created
{
"object": "space",
"id": "text",
"title": "text",
"emoji": "๐",
"visibility": "public",
"createdAt": "2025-11-06T14:38:24.382Z",
"updatedAt": "2025-11-06T14:38:24.382Z",
"deletedAt": "2025-11-06T14:38:24.382Z",
"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-11-06T14:38:24.382Z"
},
"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
}
}The unique id of the space
Space duplicated
POST /v1/spaces/{spaceId}/duplicate HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Space duplicated
{
"object": "space",
"id": "text",
"title": "text",
"emoji": "๐",
"visibility": "public",
"createdAt": "2025-11-06T14:38:24.382Z",
"updatedAt": "2025-11-06T14:38:24.382Z",
"deletedAt": "2025-11-06T14:38:24.382Z",
"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-11-06T14:38:24.382Z"
},
"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
}
}The unique id of the space
The space has been updated
PATCH /v1/spaces/{spaceId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 120
{
"editMode": "live",
"title": "text",
"defaultLevel": "admin",
"language": "en",
"mergeRules": {
"type": "inherit"
},
"emoji": "๐"
}The space has been updated
{
"object": "space",
"id": "text",
"title": "text",
"emoji": "๐",
"visibility": "public",
"createdAt": "2025-11-06T14:38:24.382Z",
"updatedAt": "2025-11-06T14:38:24.382Z",
"deletedAt": "2025-11-06T14:38:24.382Z",
"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-11-06T14:38:24.382Z"
},
"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
}
}Was this helpful?