Imports

Import content into GitBook.

The Imports API provides allows you to import content into GitBook.

Import content into a space from a website

post
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

Body
sourceone ofRequired
or
enhancebooleanOptional

Enhance the imported content with AI

Default: true
Responses
201

Import run created successfully.

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

{
  "source": {
    "type": "website",
    "url": "https://example.com"
  },
  "target": {
    "space": "text",
    "changeRequest": "text",
    "page": "text"
  },
  "enhance": true
}
{
  "id": "text",
  "startedAt": "2025-11-05T02:41:24.887Z",
  "completedAt": "2025-11-05T02:41:24.887Z",
  "status": "pending",
  "pages": [
    {
      "id": "text",
      "sourceURL": "text",
      "type": "page",
      "status": "complete"
    }
  ]
}

Cancel an import run

post
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

importRunIdstringRequired

The unique id of the import run

Responses
201

Import run canceled successfully.

application/json
post
/org/{organizationId}/imports/{importRunId}/cancel
POST /v1/org/{organizationId}/imports/{importRunId}/cancel HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "text",
  "startedAt": "2025-11-05T02:41:24.887Z",
  "completedAt": "2025-11-05T02:41:24.887Z",
  "status": "pending",
  "pages": [
    {
      "id": "text",
      "sourceURL": "text",
      "type": "page",
      "status": "complete"
    }
  ]
}

Last updated

Was this helpful?