VoltPlan Sharing API

Diagram sharing through share tokens stored on PocketBase `wireframe_states` records, wireframe preview images, and conversion of PocketBase component images to data URLs. No authentication.

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 8

POST /api/share/diagram Retired: create a shared diagram #
GET /api/share/diagram/{token}/png Redirect a share token to the diagram preview PNG #
POST /api/share/generate-token Get or create the share token of a wireframe #
POST /api/share/save-png Store the preview PNG of a shared wireframe #
GET /api/share/{token}/{filename} Serve the stored PNG of a shared wireframe #
GET /api/wireframe/{id}/preview Render a wireframe preview image (PNG) #
GET /api/wireframe/{id}/preview-svg Render a wireframe preview image (SVG) #
POST /api/convert-image Convert a PocketBase component image to a data URL #

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/voltplan-app:voltplan-app-sharing-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

voltplan-app-sharing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: VoltPlan Sharing API
  version: 0.3.0
  description: 'VoltPlan''s HTTP API. The wiring-diagram MCP server (Model Context Protocol over Streamable HTTP, tag `MCP`, at `/.well-known/mcp`) generates 12V/24V/48V wiring diagrams and performs wire gauge, fuse, battery bank, inverter, solar, and charging-time calculations; it needs no API key or account. The REST endpoints under `/api` serve the VoltPlan web app. Authentication: public endpoints need no credentials; user endpoints expect a PocketBase `users` auth token as `Authorization: Bearer ` (`userBearer`); admin endpoints additionally require `is_admin=true` and answer 403 otherwise (`adminBearer`); the IndexNow trigger uses a shared secret (`indexNowBearer`). Each operation''s `security` field names its requirement.'
  contact:
    name: VoltPlan
    url: https://voltplan.app/developers
    email: support@voltplan.app
  license:
    name: MIT
    url: https://github.com/YUZU-Hub/wiring-diagram-mcp/blob/main/LICENSE
servers:
- url: https://voltplan.app
tags:
- name: Sharing
  description: Diagram sharing through share tokens stored on PocketBase `wireframe_states` records, wireframe preview images, and conversion of PocketBase component images to data URLs. No authentication.
paths:
  /api/share/diagram:
    post:
      operationId: createSharedDiagram
      tags:
      - Sharing
      deprecated: true
      summary: 'Retired: create a shared diagram'
      description: Retired endpoint; always answers 410 Gone. Sharing now uses the `share_token` on the PocketBase `wireframe_states` record — call `POST /api/share/generate-token`. The request body is ignored.
      responses:
        '410':
          description: Endpoint retired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareDeprecatedError'
              example:
                error: This API endpoint is deprecated. Sharing now uses wireframe_states directly.
                deprecated: true
  /api/share/diagram/{token}/png:
    parameters:
    - name: token
      in: path
      required: true
      description: Share token stored in the `share_token` field of a PocketBase `wireframe_states` record (issued by `POST /api/share/generate-token`, 16 alphanumeric characters).
      schema:
        type: string
    get:
      operationId: getSharedDiagramPng
      tags:
      - Sharing
      summary: Redirect a share token to the diagram preview PNG
      description: Looks up the PocketBase `wireframe_states` record whose `share_token` equals `token` and redirects to `/api/wireframe/{id}/preview/` of that record. Depends on the wireframe having a share token. Lookup errors are answered like an unknown token.
      responses:
        '302':
          description: Redirect to the preview image of the shared wireframe.
          headers:
            Location:
              description: Absolute URL of `/api/wireframe/{id}/preview/` on the requesting origin.
              schema:
                type: string
                format: uri
        '404':
          description: No wireframe has this share token, or the lookup failed.
          content:
            text/plain:
              schema:
                type: string
              example: Shared diagram not found
  /api/share/generate-token:
    post:
      operationId: generateShareToken
      tags:
      - Sharing
      summary: Get or create the share token of a wireframe
      description: 'Authenticates server-side as PocketBase superuser, returns the `share_token` of the `wireframe_states` record `wireframeId`, and generates and stores a new 16-character token (crypto-random, alphanumeric) when the record has none. A wireframe with an `owner` is only shared for that owner (`Authorization: Bearer `); an ownerless wireframe needs no token. PocketBase errors are answered with their HTTP status and message (status 500 when none).'
      security:
      - {}
      - userBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShareTokenRequest'
      responses:
        '200':
          description: Share token of the wireframe.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareTokenResponse'
              example:
                shareToken: aB3dE5fG7hJ9kL1m
        '400':
          description: '`wireframeId` missing or empty, or PocketBase rejected the superuser login or the update.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingWireframeId:
                  value:
                    error: wireframeId is required
        '403':
          description: The wireframe has an owner and the caller is not that owner (no, invalid or another user's token); no token is returned or created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notOwner:
                  value:
                    error: Only the owner can share this wireframe
        '404':
          description: No `wireframe_states` record with this id (PocketBase message).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  value:
                    error: The requested resource wasn't found.
        '500':
          description: Superuser credentials (`POCKETBASE_ADMIN_EMAIL`, `POCKETBASE_ADMIN_PASSWORD`) not configured, malformed JSON body, or PocketBase unreachable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                credentials:
                  value:
                    error: Admin credentials not configured
                fallback:
                  value:
                    error: Failed to generate share token
  /api/share/save-png:
    post:
      operationId: saveSharePng
      tags:
      - Sharing
      summary: Store the preview PNG of a shared wireframe
      description: 'Authenticates server-side as PocketBase superuser and uploads `preview_image` into the `preview_image` field of the `wireframe_states` record `wireframeId`; `GET /api/share/{token}/{filename}` later serves it. A wireframe with an `owner` only accepts the upload from that owner (`Authorization: Bearer `); an ownerless wireframe needs no token. PocketBase errors are answered with their HTTP status and message (status 500 when none).'
      security:
      - {}
      - userBearer: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SharePngUpload'
      responses:
        '200':
          description: PNG stored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharePngSaved'
              example:
                success: true
        '400':
          description: '`wireframeId` or `preview_image` missing, or PocketBase rejected the superuser login or the file.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingFields:
                  value:
                    error: wireframeId and preview_image are required
        '403':
          description: The wireframe has an owner and the caller is not that owner (no, invalid or another user's token); nothing is stored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notOwner:
                  value:
                    error: Only the owner can share this wireframe
        '404':
          description: No `wireframe_states` record with this id (PocketBase message).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  value:
                    error: The requested resource wasn't found.
        '500':
          description: Superuser credentials not configured, body is not multipart/form-data, or PocketBase unreachable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                credentials:
                  value:
                    error: Admin credentials not configured
                fallback:
                  value:
                    error: Failed to save PNG
  /api/share/{token}/{filename}:
    parameters:
    - name: token
      in: path
      required: true
      description: Share token stored in the `share_token` field of a PocketBase `wireframe_states` record (issued by `POST /api/share/generate-token`, 16 alphanumeric characters).
      schema:
        type: string
    - name: filename
      in: path
      required: true
      description: Download name; must match `voltplan-<name>.png` with `<name>` 1–64 characters of `A-Z a-z 0-9 _ -`, otherwise 400. Only the validated `<name>` is reused in `Content-Disposition`.
      schema:
        type: string
        pattern: ^voltplan-[A-Za-z0-9_-]{1,64}\.png$
    get:
      operationId: getSharedPng
      tags:
      - Sharing
      summary: Serve the stored PNG of a shared wireframe
      description: Finds the PocketBase `wireframe_states` record whose `share_token` equals `token` (unauthenticated read that also sends the token as `?share_token=`, which the collection list rule requires for other users' records) and proxies its stored `preview_image` (saved by `POST /api/share/save-png`) without exposing the PocketBase URL. Depends on the wireframe having a share token and a stored preview image. The filename is checked first (400); a `token` that is not exactly 16 alphanumeric characters answers 404 `Wireframe not found` without a lookup.
      responses:
        '200':
          description: The stored PNG.
          headers:
            Content-Length:
              description: Byte length of the PNG.
              schema:
                type: integer
            Content-Disposition:
              description: '`inline; filename="voltplan-<name>.png"`'
              schema:
                type: string
            Cache-Control:
              schema:
                type: string
                enum:
                - public, max-age=31536000, immutable
          content:
            image/png:
              schema:
                type: string
                format: binary
        '400':
          description: '`filename` does not match `voltplan-<name>.png`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalidFilename:
                  value:
                    error: Invalid filename format
        '404':
          description: Malformed or unknown share token, no stored PNG, or the stored file could not be fetched.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unknownToken:
                  value:
                    error: Wireframe not found
                noPng:
                  value:
                    error: PNG not available. Generate by sharing the wireframe first.
                unreachable:
                  value:
                    error: PNG file not accessible
        '500':
          description: PocketBase lookup or file fetch threw.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                failed:
                  value:
                    error: Failed to serve PNG
  /api/wireframe/{id}/preview:
    parameters:
    - name: id
      in: path
      required: true
      description: PocketBase `wireframe_states` record id.
      schema:
        type: string
    get:
      operationId: getWireframePreview
      tags:
      - Sharing
      summary: Render a wireframe preview image (PNG)
      description: Renders the PocketBase `wireframe_states` record `id` (with its components) to PNG. Read with the unauthenticated server PocketBase client; does not use the share token. Falls back to SVG when PNG conversion yields nothing, and to a generic VoltPlan SVG (shorter cache) when rendering throws. Any lookup failure answers 404.
      responses:
        '200':
          description: 'Preview image: PNG, or SVG when PNG conversion is unavailable or rendering failed.'
          headers:
            Cache-Control:
              description: '`public, max-age=3600, s-maxage=3600` for a rendered preview; `public, max-age=300, s-maxage=300` for the fallback image served when rendering throws.'
              schema:
                type: string
                enum:
                - public, max-age=3600, s-maxage=3600
                - public, max-age=300, s-maxage=300
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/svg+xml:
              schema:
                type: string
        '404':
          description: Record missing or not readable.
          content:
            text/plain:
              schema:
                type: string
              example: Wireframe not found
  /api/wireframe/{id}/preview-svg:
    parameters:
    - name: id
      in: path
      required: true
      description: PocketBase `wireframe_states` record id.
      schema:
        type: string
    get:
      operationId: getWireframePreviewSvg
      tags:
      - Sharing
      summary: Render a wireframe preview image (SVG)
      description: Renders the PocketBase `wireframe_states` record `id` (with its components) to SVG; image references point at `NEXT_PUBLIC_BASE_URL` or the request origin. Read with the unauthenticated server PocketBase client; does not use the share token. Rendering errors answer a generic VoltPlan SVG with a shorter cache. Any lookup failure answers 404.
      responses:
        '200':
          description: Preview SVG, or the generic fallback SVG when rendering failed.
          headers:
            Cache-Control:
              description: '`public, max-age=3600, s-maxage=3600` for a rendered preview; `public, max-age=300, s-maxage=300` for the fallback image served when rendering throws.'
              schema:
                type: string
                enum:
                - public, max-age=3600, s-maxage=3600
                - public, max-age=300, s-maxage=300
          content:
            image/svg+xml:
              schema:
                type: string
        '404':
          description: Record missing or not readable.
          content:
            text/plain:
              schema:
                type: string
              example: Wireframe not found
  /api/convert-image:
    post:
      operationId: convertImageToDataUrl
      tags:
      - Sharing
      summary: Convert a PocketBase component image to a data URL
      description: Takes the path and query of `imageUrl`, which must lie under `/api/files/components/`, and fetches that file server-side from VoltPlan's own PocketBase; the host in `imageUrl` is ignored. Returns it base64-encoded as a data URL. Independent of share tokens. No authentication.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConvertImageRequest'
      responses:
        '200':
          description: Image as data URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertImageResponse'
        '400':
          description: '`imageUrl` missing, not a string, or its path is not under `/api/files/components/`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missing:
                  value:
                    error: Image URL is required
                notAllowed:
                  value:
                    error: Only PocketBase component images are allowed
        '404':
          description: PocketBase answered something other than 200 with an `image/*` body (at most 5 MB), or was unreachable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                fetchFailed:
                  value:
                    error: Failed to fetch image
        '500':
          description: Malformed JSON body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal:
                  value:
                    error: Internal server error
components:
  schemas:
    SharePngUpload:
      type: object
      description: multipart/form-data fields read by POST /api/share/save-png.
      required:
      - wireframeId
      - preview_image
      additionalProperties: false
      properties:
        wireframeId:
          type: string
          minLength: 1
          description: PocketBase `wireframe_states` record id.
        preview_image:
          type: string
          format: binary
          description: PNG file stored as the record's `preview_image`.
    ConvertImageResponse:
      type: object
      description: Result of POST /api/convert-image.
      required:
      - dataUrl
      additionalProperties: false
      properties:
        dataUrl:
          type: string
          pattern: '^data:'
          description: '`data:<upstream Content-Type, default image/png>;base64,<bytes>`.'
    ErrorResponse:
      type: object
      description: Error body returned by VoltPlan REST endpoints.
      required:
      - error
      properties:
        error:
          type: string
          description: Human-readable error message.
        details:
          type: string
          description: Optional extra context about the failure.
    ShareDeprecatedError:
      type: object
      description: Body of the retired POST /api/share/diagram.
      required:
      - error
      - deprecated
      additionalProperties: false
      properties:
        error:
          type: string
        deprecated:
          type: boolean
          const: true
    ConvertImageRequest:
      type: object
      description: Body of POST /api/convert-image.
      required:
      - imageUrl
      additionalProperties: false
      properties:
        imageUrl:
          type: string
          description: Absolute URL that must contain `/api/files/components/` (PocketBase component file).
    SharePngSaved:
      type: object
      description: Acknowledgement of POST /api/share/save-png.
      required:
      - success
      additionalProperties: false
      properties:
        success:
          type: boolean
          const: true
    ShareTokenRequest:
      type: object
      description: Body of POST /api/share/generate-token.
      required:
      - wireframeId
      additionalProperties: false
      properties:
        wireframeId:
          type: string
          minLength: 1
          description: PocketBase `wireframe_states` record id; missing or empty → 400.
    ShareTokenResponse:
      type: object
      description: Share token returned by POST /api/share/generate-token.
      required:
      - shareToken
      additionalProperties: false
      properties:
        shareToken:
          type: string
          description: Existing `share_token` of the record, or a newly generated 16-character alphanumeric token.
  securitySchemes:
    userBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'PocketBase `users` auth token sent as `Authorization: Bearer <token>`. The server validates it per request with a PocketBase `authRefresh` call.'
    adminBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Same PocketBase `users` auth token as `userBearer`, validated with `authRefresh`; the user record must additionally have `is_admin=true`. Missing, invalid and non-admin tokens all receive 403 (`AdminForbidden`).
    indexNowBearer:
      type: http
      scheme: bearer
      description: 'Shared secret configured server-side as `INDEXNOW_SECRET`, sent as `Authorization: Bearer <secret>`. A missing or wrong secret receives 401.'
externalDocs:
  description: MCP server source, tool parameter schemas, and changelog
  url: https://github.com/YUZU-Hub/wiring-diagram-mcp
x-mcp-tools:
- name: generate_wiring_diagram
  description: Generate a complete 12V/24V/48V wiring diagram from a list of components (batteries, loads, chargers, solar panels, inverters). Returns PNG or SVG.
- name: calculate_wire_gauge
  description: Calculate the correct wire gauge (AWG and mm²), voltage drop, and fuse size for a DC circuit given voltage, current, and cable length.
- name: calculate_battery_bank
  description: Size a battery bank for a given daily energy demand, days of autonomy, and depth of discharge.
- name: calculate_battery_config
  description: Work out a series/parallel configuration of individual cells or batteries for a target system voltage and capacity.
- name: calculate_charging_time
  description: Estimate battery charging time from a given charger or solar array.
- name: calculate_inverter_size
  description: Recommend an inverter size based on AC load profile, surge requirements, and system voltage.
- name: calculate_power_budget
  description: Build a 24h power budget from loads to size batteries, solar, and wiring.
- name: calculate_solar_size
  description: Size a solar array based on daily energy needs, location / sun hours, and system voltage.
- name: list_component_types
  description: List the component types VoltPlan knows about (batteries, chargers, loads, inverters, panels, etc.).
- name: find_components
  description: Find products in VoltPlan's small, curated component catalogue that match a spec (category, system voltage, watts, Ah/Wh, pure sine, free text), closest rating first, with product pages and buy links plus an always-available Amazon search fallback.
- name: build_bom
  description: 'Build the full shopping list (bill of materials) for a system described like generate_wiring_diagram: components with matching catalogue products, cables per gauge, fuses, fuse holders, terminals, heat-shrink, and tools, with buy links.'