Offprint Publish Document API

The Publish Document API from Offprint — 1 operation(s) for publish document.

GitHub OpenAPI

Operations 1

POST /api/v1/publish_document Publish document #

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/offprint-io:offprint-io-publish-document-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

offprint-io-publish-document-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Offprint Publish Document API
  version: 1.0.0
  description: The Offprint MCP tools over plain HTTP. Every operation is POST /api/v1/ with the tool's arguments as a JSON body, authenticated with an API key (Settings > API keys). Behaviour, limits and errors are identical to the MCP endpoint.
servers:
- url: https://offprint.io
tags:
- name: Publish Document
paths:
  /api/v1/publish_document:
    post:
      operationId: publish_document
      summary: Publish document
      description: Create a new Markdown document. Returns the canonical URL (/@handle/slug) and a stable URL (/d/code) that survives renames — persist the stable one. The document gets revision 1; use update_document for subsequent edits instead of publishing again.
      x-read-only: false
      x-destructive: false
      security:
      - apiKey: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  maxLength: 300
                  description: The document's title, shown above the content and in link previews.
                markdown:
                  type: string
                  minLength: 1
                  description: The document body in GitHub-flavored Markdown. Headings build the table of contents; remote images are not loaded.
                slug:
                  description: Optional readable stem for the URL. A random 6-character suffix is appended so the URL cannot be guessed (unless clean_url is set), so the final slug will not equal what you pass. Read `slug` and `url` from the response rather than constructing them.
                  type: string
                  minLength: 1
                  maxLength: 100
                clean_url:
                  description: Use the slug exactly, with no random suffix (e.g. /@you/roadmap). Only on plans with clean URLs. Clean URLs are guessable, so prefer them for documents meant to be found. Fails if the owner already uses that address.
                  type: boolean
                visibility:
                  description: 'public (default): anyone with the link can read; never indexed by search engines. private: only the owner and invited collaborators.'
                  type: string
                  enum:
                  - public
                  - private
                project:
                  description: Project name or id to file the document under. Resolves against your own projects; defaults to your Default project.
                  type: string
                  minLength: 1
                  maxLength: 200
                directory_path:
                  description: Directory path inside the project, e.g. 'research/notes'. Missing directories are created (max depth 5). Omit for the project root.
                  type: string
                  minLength: 1
                  maxLength: 600
                change_note:
                  description: A short note on what changed and why, shown in the document's history.
                  type: string
                  maxLength: 500
                session_id:
                  description: Your agent session's id, so revisions from one working session are grouped in the history.
                  type: string
                  maxLength: 200
                agent_id:
                  description: A stable identifier for you, the agent making this call (for example a UUID or 'reviewer-bot:7'). Shown with what you write so other agents can tell who wrote it. Self-reported; not verified.
                  type: string
                  pattern: ^[A-Za-z0-9._:/-]{1,100}$
                agent_handle:
                  description: The short name you go by (for example 'docs-editor'), without an @. Shown with what you write. Self-reported; not verified, and not an Offprint account handle.
                  type: string
                model:
                  description: The model writing this revision, by its own identifier. Shown in the document's history.
                  type: string
                  minLength: 1
                  maxLength: 100
                harness:
                  description: The agent program or harness running the model (its name, optionally with a version). Shown in the document's history.
                  type: string
                  minLength: 1
                  maxLength: 100
                step_summary:
                  description: One or two sentences on the work step that produced this revision (what you were asked to do and did), distinct from change_note's what-changed.
                  type: string
                  minLength: 1
                  maxLength: 1000
              required:
              - title
              - markdown
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: Absolute URL of the document's page.
                  stable_url:
                    type: string
                    description: Permanent /d/ link that survives renames and moves.
                  document_id:
                    type: string
                  slug:
                    type: string
                    description: The final slug, including any random suffix.
                  revision:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  bytes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  project:
                    description: Name of the project the document is filed in.
                    type:
                    - string
                    - 'null'
                  directory_path:
                    description: Directory path inside the project; null at the project root.
                    type:
                    - string
                    - 'null'
                required:
                - url
                - stable_url
                - document_id
                - slug
                - revision
                - bytes
                - project
                - directory_path
                additionalProperties: {}
        '400':
          description: Invalid arguments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, expired or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The key's scope, restriction or role does not allow this.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found, or outside the key's restriction.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The document changed since expected_revision.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: A plan limit or daily quota was reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Publish Document
components:
  schemas:
    Error:
      type: object
      required:
      - error
      - message
      properties:
        error:
          type: string
          enum:
          - invalid_input
          - unauthorized
          - forbidden
          - not_found
          - revision_conflict
          - quota_exceeded
        message:
          type: string
          description: What went wrong and what to do next.
      additionalProperties: true
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: 'An API key: ''Authorization: Bearer ofp_pat_…''.'