Pull content into a space from a connected Git repository
A unique entity identifier
^[a-zA-Z0-9_-]+$URL of the Git repository to import. It can contain basic auth credentials.
Git ref to import in the format "refs/heads/main"
Unique identifier to use to cache the Git repository across multiple operations.
URL to use as a prefix for external file references.
URL to use as a prefix for the commit URL.
Path to a root directory for the project in the repository.
The timestamp of the event that triggered this import. It ensures that Git sync import and export operations are executed in the same order on GitBook and on the remote repository.
If true, the import will generate a revision without updating the space primary content.
Operation to import the repository has been queued.
No content
POST /v1/spaces/{spaceId}/git/import HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 171
{
"url": "text",
"ref": "text",
"repoTreeURL": "text",
"repoCommitURL": "text",
"repoProjectDirectory": "text",
"timestamp": "2026-01-01T00:00:00.000Z",
"force": true,
"standalone": true
}Operation to import the repository has been queued.
No content
Last updated
Was this helpful?