WitWiki Imports API

The Imports API from WitWiki, for imports.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 6

GET /api/imports/notion/preflight Size the Notion workspace shared with WitWiki (role: admin+; feature… #
POST /api/imports/notion Start a Notion import into a new project (role: admin+; feature: notion_import) #
GET /api/imports List the org's imports (role: member+; feature: notion_import) #
GET /api/imports/{id} An import and how far it has got (role: member+; feature: notion_import) #
POST /api/imports/{id}/cancel Cancel a queued, running or paused import (role: admin+; feature: notion_import) #
GET /api/imports/{id}/report What an import did with every Notion page, and what a person still has to look… #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/witwiki-app:witwiki-app-imports-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

witwiki-app-imports-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WitWiki Imports API
  version: 1.0.0
  description: 'REST API for **WitWiki** — a hosted, MCP-native, cross-linked knowledge base

    that gives LLM agents and humans a shared, persistent wiki.


    This document is hand-authored (source at `api/internal/openapi/openapi.yaml`,

    embedded into the binary) and served at `GET /openapi.yaml`, with interactive

    Swagger UI at `GET /docs`. It covers the

    REST surface rooted at `/api`, plus the open auth routes, OAuth discovery, and

    the Stripe webhook. The MCP transport at `/mcp` is documented separately

    (`docs/witwiki-mcp.md`); it is not a REST surface.


    ## Authentication

    All `/api/*` routes (except the open auth routes below) require a bearer token

    in the `Authorization` header. The token may be either:

    - a **project API key** (resolves directly to a project), or

    - a **JWT session access token** (from `POST /api/auth/login`). On the JWT path,

    send the active project in the `X-Project-ID` header.


    ## Errors

    Errors are returned as `{ "error": "" }` with an appropriate status

    (400 invalid input, 401 unauthenticated, 403 role/scope denied, 404 not found,

    402 quota exceeded, 409/410 transfer state conflicts, 500 internal).'
servers:
- url: https://api.witwiki.app
  description: Production
- url: http://localhost:8080
  description: Local development
security:
- bearerAuth: []
tags:
- name: Imports
paths:
  /api/imports/notion/preflight:
    get:
      tags:
      - Imports
      summary: 'Size the Notion workspace shared with WitWiki (role: admin+; feature…'
      description: Reads the whole workspace on the org's Notion token, so it is refused while an import is queued, running or paused, and in an operator's view-as-customer session.
      responses:
        '200':
          description: What an import would take, and the most pages one import may take
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotionPreflight'
        '403':
          description: Not an admin, an operator viewing as another user, or an API key or a delegated OAuth token ("Imports are managed in the WitWiki app.")
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: An import is already running (Notion is not called), Notion is not connected, or Notion refused the connection
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Import is not set up on this server (it has no language model); Notion is not called
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: getApiImportsNotionPreflight
      x-operation-id-source: derived
  /api/imports/notion:
    post:
      tags:
      - Imports
      summary: 'Start a Notion import into a new project (role: admin+; feature: notion_import)'
      description: Creates the project and queues the import; the job runs in the background. A person starts it, so API keys get 403. The org's project quota applies, as for a new project. 422 when nothing is shared or more pages are shared than one import takes; the message says which.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - project_name
              properties:
                project_name:
                  type: string
                  description: Name of the project to create; blank is refused.
                expected_archive_rate:
                  type: number
                  minimum: 0
                  maximum: 1
                  description: Fraction of pages the person expects to leave out, if they know; 0 means none, absent or null means not answered.
      responses:
        '202':
          description: The queued import
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportJob'
        '400':
          $ref: '#/components/responses/BadRequest'
        '402':
          $ref: '#/components/responses/QuotaExceeded'
        '403':
          description: Not an admin, a caller with no user, or an API key or a delegated OAuth token ("Imports are managed in the WitWiki app.")
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: An import is already active, Notion is not connected, or Notion refused the connection
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Nothing is shared with the integration, or too many pages are
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Import is not set up on this server (it has no language model); Notion is not called and nothing is created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: postApiImportsNotion
      x-operation-id-source: derived
  /api/imports:
    get:
      tags:
      - Imports
      summary: 'List the org''s imports (role: member+; feature: notion_import)'
      responses:
        '200':
          description: Imports; an empty array when none
          content:
            application/json:
              schema:
                type: object
                properties:
                  imports:
                    type: array
                    items:
                      $ref: '#/components/schemas/ImportJob'
        '403':
          description: Not a member, or an API key or a delegated OAuth token ("Imports are managed in the WitWiki app.")
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: getApiImports
      x-operation-id-source: derived
  /api/imports/{id}:
    parameters:
    - $ref: '#/components/parameters/IDPath'
    get:
      tags:
      - Imports
      summary: 'An import and how far it has got (role: member+; feature: notion_import)'
      description: Another org's import is 404.
      responses:
        '200':
          description: The import and its progress
          content:
            application/json:
              schema:
                type: object
                properties:
                  import:
                    $ref: '#/components/schemas/ImportJob'
                  progress:
                    $ref: '#/components/schemas/ImportProgress'
        '403':
          description: Not a member, or an API key or a delegated OAuth token ("Imports are managed in the WitWiki app.")
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: getApiImportsById
      x-operation-id-source: derived
  /api/imports/{id}/cancel:
    parameters:
    - $ref: '#/components/parameters/IDPath'
    post:
      tags:
      - Imports
      summary: 'Cancel a queued, running or paused import (role: admin+; feature: notion_import)'
      description: A running worker stops at its next write. Another org's import is 404.
      responses:
        '204':
          description: Cancelled
        '403':
          description: Not an admin, or an API key or a delegated OAuth token ("Imports are managed in the WitWiki app.")
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: The import has already ended
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: postApiImportsByIdCancel
      x-operation-id-source: derived
  /api/imports/{id}/report:
    parameters:
    - $ref: '#/components/parameters/IDPath'
    get:
      tags:
      - Imports
      summary: What an import did with every Notion page, and what a person still has to look…
      description: 'Computed on each request from the import''s records and the pages'' current content: a disagreement is open while its block is in its page, however it left. An import that has not finished is reported as far as it got, with complete false. Another org''s import is 404.'
      responses:
        '200':
          description: The report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportReport'
        '403':
          description: Not a member, or an API key or a delegated OAuth token ("Imports are managed in the WitWiki app.")
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: getApiImportsByIdReport
      x-operation-id-source: derived
components:
  schemas:
    NotionSizing:
      type: object
      properties:
        pages:
          type: integer
          description: Every shared page, database rows included.
        sections:
          type: integer
          description: Distinct first path segments.
        stale:
          type: integer
          description: Pages not edited in the last 12 months.
        databases:
          type: array
          description: Every shared database; an empty array, never null, when there are none.
          items:
            type: object
            properties:
              title:
                type: string
              rows:
                type: integer
              rows_incomplete:
                type: boolean
                description: Notion refused to query the database, so rows counts only what search returned.
    Error:
      type: object
      properties:
        error:
          type: string
      required:
      - error
    ImportReport:
      type: object
      properties:
        verdict:
          type: string
          enum:
          - pass
          - needs_review
          - invalid
          description: At least needs_review while a page has no decision or a target is planned or written.
        project_id:
          type: string
          description: The project the import writes into, for links to its pages; set whether or not the import has finished.
        status:
          type: string
          enum:
          - queued
          - running
          - paused
          - failed
          - cancelled
          - done
          description: The import's status, so an unfinished one says how far it got.
        step:
          type: string
          enum:
          - read
          - digest
          - plan
          - write
          - check
          - finish
        targets:
          type: object
          description: The wiki pages the plan made, counted by state.
          properties:
            planned:
              type: integer
            written:
              type: integer
            checked:
              type: integer
            needs_person:
              type: integer
        needs_attention:
          type: integer
          description: Open disagreements plus targets that need a person plus missing pages; the number the ready email gives.
        quality:
          type: object
          additionalProperties: true
          description: 'importquality''s report of the run: counts, sections, archive rate and findings.'
        open_disagreements:
          type: array
          items:
            type: object
            properties:
              target:
                type: string
                description: The wiki path of the page holding the block.
              title:
                type: string
              topic:
                type: string
              id:
                type: string
        missing_pages:
          type: array
          description: Targets whose page the import wrote (written, checked, or needing a person) that have no page at their path now. A disagreement on a missing page is neither open nor resolved and is listed nowhere else. Any missing page makes the verdict at least needs_review.
          items:
            type: object
            properties:
              target:
                type: string
                description: The wiki path the page was at.
              title:
                type: string
              disagreements:
                type: integer
                description: How many disagreements the import recorded on it.
        missing_facts:
          type: array
          items:
            type: object
            properties:
              target:
                type: string
              title:
                type: string
              fact:
                type: string
              source:
                type: string
                description: The Notion page's title; empty when the fact is about the whole page.
              raw_source_id:
                type: string
                description: The Notion page's saved original, to link to; empty when the fact is about the whole page or no original was saved.
        left_out:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              reason:
                type: string
              raw_source_id:
                type: string
                description: The saved original; empty when none was saved.
              url:
                type: string
              superseded_by:
                type: string
                description: The wiki path of the page that replaced it; empty when none did.
        not_checked:
          type: array
          items:
            type: string
        complete:
          type: boolean
          description: True only when the import is done.
    ImportJob:
      type: object
      properties:
        id:
          type: string
        org_id:
          type: string
        project_id:
          type: string
        started_by:
          type: string
        status:
          type: string
          enum:
          - queued
          - running
          - paused
          - failed
          - cancelled
          - done
        step:
          type: string
          enum:
          - read
          - digest
          - plan
          - write
          - check
          - finish
        expected_archive_rate:
          type:
          - number
          - 'null'
        ceiling_micros:
          type: integer
          format: int64
          description: Most the import may spend, in micro-dollars.
        spent_micros:
          type: integer
          format: int64
          description: Spent so far, in micro-dollars.
        pages_total:
          type: integer
        error:
          type: string
          description: Why a failed import stopped, in a sentence for the org's admins; empty otherwise.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        finished_at:
          type:
          - string
          - 'null'
          format: date-time
    ImportProgress:
      type: object
      properties:
        pages_read:
          type: integer
        pages_total:
          type: integer
        digested:
          type: integer
        targets_planned:
          type: integer
        targets_written:
          type: integer
        targets_checked:
          type: integer
    NotionPreflight:
      description: The preflight response, the workspace's sizing and the page limit.
      allOf:
      - $ref: '#/components/schemas/NotionSizing'
      - type: object
        properties:
          max_pages:
            type: integer
            description: The most pages one import may take, as this server is configured.
  responses:
    BadRequest:
      description: Invalid input
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    QuotaExceeded:
      description: Plan quota exceeded (upgrade required)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    IDPath:
      name: id
      in: path
      required: true
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A project API key or a JWT session access token.