Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: VoltPlan Account 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: Account
description: 'Public account and list sign-up endpoints used by the web app: stepped-login email lookup, email verification, newsletter subscribe/unsubscribe, app tester sign-up and app waitlist. None of them requires authentication; they call PocketBase server-side (unauthenticated client, except email-status which uses the superuser client).'
paths:
/api/auth/email-status:
post:
operationId: lookupEmailStatus
tags:
- Account
summary: Look up which sign-in path an email address needs
description: 'No authentication. Drives the second step of the stepped login.
- Rate limit, checked before the body is parsed: more than 15 requests within 60 s from one client IP answer 429. The IP is the first `x-forwarded-for` entry, else `x-real-ip`, else the shared bucket `unknown`. The limiter is in-memory per server instance, and rejected requests count toward the window.
- `email` is normalized with `String(email ?? '''').trim().toLowerCase()`; a non-JSON body answers 400 `Invalid request`, an empty or malformed email (`^[^\s@]+@[^\s@]+\.[^\s@]+$`) 400 `Invalid email`.
- The `users` lookup and the external-auth listing run with the PocketBase superuser client (`getAdminPb`, `POCKETBASE_ADMIN_EMAIL` / `POCKETBASE_ADMIN_PASSWORD`).
- `new`: no account with this email. `oauth`: the account is linked to Google and/or Apple. `password`: any other account. Every backend failure (including the superuser login) also answers `password`, so this operation never returns 500.'
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthEmailStatusRequest'
responses:
'200':
description: Sign-in path for the email address.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthEmailStatusResponse'
'400':
description: Body is not JSON, or the email is empty or malformed after normalization.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthEmailStatusBadRequest'
examples:
invalidRequest:
value:
error: Invalid request
invalidEmail:
value:
error: Invalid email
'429':
description: More than 15 requests from this client IP within 60 seconds.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthEmailStatusRateLimited'
examples:
tooManyRequests:
value:
error: Too many requests
/api/auth/verify-email:
post:
operationId: verifyEmail
tags:
- Account
summary: Confirm an email address with a PocketBase verification token
description: No authentication. Calls `users.confirmVerification(token)` with an unauthenticated PocketBase client (`POCKETBASE_URL`); no superuser client is involved. A PocketBase 404 or a token field error answers 400; any other PocketBase failure answers 500 with the PocketBase field errors in `details`. A truthy non-string `token` (e.g. a number) is not rejected up front and ends in 500 `Failed to verify email`. A non-JSON or `null` body answers 500 `Internal server error`.
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthVerifyEmailRequest'
responses:
'200':
description: Email address verified.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthVerifyEmailResponse'
'400':
description: Token missing, unknown, expired or rejected by PocketBase.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthVerifyEmailBadRequest'
examples:
verificationTokenIsRequired:
value:
error: Verification token is required
invalidOrExpiredVerificationToken:
value:
error: Invalid or expired verification token
invalidVerificationToken:
value:
error: Invalid verification token
'500':
description: PocketBase failed for another reason, or the body could not be read.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthVerifyEmailServerError'
examples:
failedToVerifyEmail:
value:
error: Failed to verify email
internalServerError:
value:
error: Internal server error
/api/newsletter/subscribe:
post:
operationId: subscribeNewsletter
tags:
- Account
summary: Subscribe an email address to the newsletter
description: 'No authentication. Uses an unauthenticated PocketBase client (`POCKETBASE_URL`); no superuser client is involved.
- `email` must be a non-empty string (else 400 `Email is required`); it is trimmed (not lowercased) and must then be at most 254 characters and match `^[^\s@]+@[^\s@]+\.[^\s@]+$` (else 400 `Invalid email`). The trimmed value is used from then on.
- An existing `users` record with this email (or a PocketBase `validation_not_unique` error on `email`) answers 200 with `isExisting: true`.
- Otherwise a `users` record is created via `POST /api/collections/users/records` with a random server-side password, `name` derived from the email local part, `emailVisibility: false`, `newsletter_source` (= `source`, default `landing_page`) and `newsletter_subscribed_at`. The PocketBase verification email is then requested; a failure there is ignored. The answer is 200 with `needsVerification: true`.
- Any other PocketBase failure answers 500 `Failed to subscribe`; a non-JSON or `null` body answers 500 `Internal server error`.'
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/NewsletterSubscribeRequest'
responses:
'200':
description: Account created (verification pending) or already subscribed.
content:
application/json:
schema:
$ref: '#/components/schemas/NewsletterSubscribeResponse'
'400':
description: '`email` missing, not a string or empty (`Email is required`), or longer than 254 characters / not matching the email pattern after trimming (`Invalid email`).'
content:
application/json:
schema:
$ref: '#/components/schemas/NewsletterSubscribeBadRequest'
examples:
emailIsRequired:
value:
error: Email is required
invalidEmail:
value:
error: Invalid email
'500':
description: PocketBase failed, or the body could not be read.
content:
application/json:
schema:
$ref: '#/components/schemas/NewsletterSubscribeServerError'
examples:
failedToSubscribe:
value:
error: Failed to subscribe
internalServerError:
value:
error: Internal server error
/api/newsletter/unsubscribe:
post:
operationId: unsubscribeNewsletter
tags:
- Account
summary: Unsubscribe an email address from the newsletter
description: No authentication. Creates a `users_unsubscribed` record `{ email, unsubscribed_at }` with an unauthenticated PocketBase client (`POCKETBASE_URL`); no superuser client is involved. `email` is only checked for presence and stored verbatim. Every PocketBase failure (duplicate, unknown address, outage) is swallowed and answers the same 200, so the response never reveals whether the address was known. A non-JSON or `null` body answers 500.
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/NewsletterUnsubscribeRequest'
responses:
'200':
description: Unsubscribe accepted.
content:
application/json:
schema:
$ref: '#/components/schemas/NewsletterUnsubscribeResponse'
'400':
description: '`email` missing or empty.'
content:
application/json:
schema:
$ref: '#/components/schemas/NewsletterUnsubscribeBadRequest'
examples:
emailIsRequired:
value:
error: Email is required
'500':
description: The body could not be read (non-JSON or `null`).
content:
application/json:
schema:
$ref: '#/components/schemas/NewsletterUnsubscribeServerError'
examples:
internalServerError:
value:
error: Internal server error
/api/testers:
post:
operationId: signUpTester
tags:
- Account
summary: Sign up as an app tester
description: 'No authentication. Creates an `app_testers` record `{ email, name, platform, status: "pending", locale, source }` with an unauthenticated PocketBase client (`POCKETBASE_URL`); no superuser client is involved.
- The email is validated first (400 `A valid email is required`), then the name (400 `Name is required`).
- A PocketBase `validation_not_unique` error on any field (unique index on email + platform) answers 200 with `isExisting: true`.
- Any other PocketBase failure answers 500 `Failed to sign up`; a non-JSON or `null` body answers 500 `Internal server error`.'
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TestersRequest'
responses:
'200':
description: On the tester list (new or existing).
content:
application/json:
schema:
$ref: '#/components/schemas/TestersResponse'
'400':
description: Email missing or malformed, or name missing.
content:
application/json:
schema:
$ref: '#/components/schemas/TestersBadRequest'
examples:
aValidEmailIsRequired:
value:
error: A valid email is required
nameIsRequired:
value:
error: Name is required
'500':
description: PocketBase failed, or the body could not be read.
content:
application/json:
schema:
$ref: '#/components/schemas/TestersServerError'
examples:
failedToSignUp:
value:
error: Failed to sign up
internalServerError:
value:
error: Internal server error
/api/waitlist:
post:
operationId: joinWaitlist
tags:
- Account
summary: Join the app waitlist
description: 'No authentication. Creates an `app_waitlist` record `{ email, platform, locale, source }` with an unauthenticated PocketBase client (`POCKETBASE_URL`); no superuser client is involved.
- An empty or malformed email answers 400 `A valid email is required`.
- A PocketBase `validation_not_unique` error on any field (unique index on email + platform) answers 200 with `isExisting: true`.
- Any other PocketBase failure answers 500 `Failed to sign up`; a non-JSON or `null` body answers 500 `Internal server error`.'
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WaitlistRequest'
responses:
'200':
description: On the waitlist (new or existing).
content:
application/json:
schema:
$ref: '#/components/schemas/WaitlistResponse'
'400':
description: Email missing or malformed.
content:
application/json:
schema:
$ref: '#/components/schemas/WaitlistBadRequest'
examples:
aValidEmailIsRequired:
value:
error: A valid email is required
'500':
description: PocketBase failed, or the body could not be read.
content:
application/json:
schema:
$ref: '#/components/schemas/WaitlistServerError'
examples:
failedToSignUp:
value:
error: Failed to sign up
internalServerError:
value:
error: Internal server error
components:
schemas:
AuthVerifyEmailBadRequest:
type: object
description: Token missing or rejected by PocketBase.
required:
- error
additionalProperties: false
properties:
error:
type: string
enum:
- Verification token is required
- Invalid or expired verification token
- Invalid verification token
AuthEmailStatusBadRequest:
type: object
description: Body is not JSON, or the email is invalid.
required:
- error
additionalProperties: false
properties:
error:
type: string
enum:
- Invalid request
- Invalid email
NewsletterSubscribeExistingResponse:
type: object
description: An account with this email already exists.
required:
- success
- message
- isExisting
additionalProperties: false
properties:
success:
const: true
message:
const: Already subscribed
isExisting:
const: true
NewsletterSubscribeBadRequest:
type: object
description: '`email` missing, not a string, empty, too long or malformed.'
required:
- error
additionalProperties: false
properties:
error:
type: string
enum:
- Email is required
- Invalid email
TestersResponse:
description: Newly added to, or already on, the tester list.
oneOf:
- $ref: '#/components/schemas/TestersCreatedResponse'
- $ref: '#/components/schemas/TestersExistingResponse'
AuthEmailStatusRateLimited:
type: object
description: Per-IP rate limit exceeded.
required:
- error
additionalProperties: false
properties:
error:
const: Too many requests
NewsletterUnsubscribeResponse:
type: object
description: Returned for every readable request with an email, whatever PocketBase answered.
required:
- success
- message
- email
additionalProperties: false
properties:
success:
const: true
message:
const: Successfully unsubscribed from newsletter
email:
type: string
description: Echo of the request email.
NewsletterUnsubscribeBadRequest:
type: object
description: '`email` missing or empty.'
required:
- error
additionalProperties: false
properties:
error:
const: Email is required
NewsletterUnsubscribeServerError:
type: object
description: The body could not be read.
required:
- error
additionalProperties: false
properties:
error:
const: Internal server error
AuthEmailStatusBasicResponse:
type: object
description: No account (`new`) or a password account / failed lookup (`password`).
required:
- status
additionalProperties: false
properties:
status:
type: string
enum:
- new
- password
TestersRequest:
type: object
required:
- email
- name
properties:
email:
type: string
description: Trimmed and lowercased server-side (`trim().toLowerCase()`); must then match `^[^\s@]+@[^\s@]+\.[^\s@]+$`. A non-string value is treated as missing.
name:
type: string
description: Trimmed; must be non-empty. A non-string value is treated as missing.
platform:
type: string
enum:
- android
- ios
default: android
description: Any other value is stored as android.
locale:
type: string
description: Truncated to 8 characters; default empty string.
source:
type: string
default: homepage_card
description: Truncated to 64 characters.
AccountPocketBaseFieldError:
type: object
description: One PocketBase field validation error.
properties:
code:
type: string
description: PocketBase error code, e.g. `validation_not_unique`.
message:
type: string
WaitlistExistingResponse:
type: object
description: Already on the waitlist for this platform.
required:
- success
- message
- isExisting
additionalProperties: false
properties:
success:
const: true
message:
const: Already on the waitlist
isExisting:
const: true
AuthEmailStatusRequest:
type: object
required:
- email
properties:
email:
type: string
description: Trimmed and lowercased server-side (`trim().toLowerCase()`); must then match `^[^\s@]+@[^\s@]+\.[^\s@]+$`.
NewsletterSubscribeResponse:
description: New account awaiting verification, or an already subscribed address.
oneOf:
- $ref: '#/components/schemas/NewsletterSubscribeCreatedResponse'
- $ref: '#/components/schemas/NewsletterSubscribeExistingResponse'
AuthVerifyEmailRequest:
type: object
required:
- token
properties:
token:
type: string
description: Verification token from the PocketBase verification email link; used as sent.
TestersBadRequest:
type: object
description: Email or name invalid.
required:
- error
additionalProperties: false
properties:
error:
type: string
enum:
- A valid email is required
- Name is required
WaitlistResponse:
description: Newly added to, or already on, the waitlist.
oneOf:
- $ref: '#/components/schemas/WaitlistCreatedResponse'
- $ref: '#/components/schemas/WaitlistExistingResponse'
AuthVerifyEmailServerError:
type: object
description: PocketBase failure or unreadable body.
required:
- error
additionalProperties: false
properties:
error:
type: string
enum:
- Failed to verify email
- Internal server error
details:
$ref: '#/components/schemas/AccountPocketBaseFieldErrors'
description: 'Only with `Failed to verify email`: PocketBase `response.data` of the failed call; omitted when PocketBase returned no data.'
NewsletterUnsubscribeRequest:
type: object
required:
- email
properties:
email:
type: string
description: Only checked for presence; stored verbatim.
NewsletterSubscribeServerError:
type: object
description: PocketBase failure or unreadable body.
required:
- error
additionalProperties: false
properties:
error:
type: string
enum:
- Failed to subscribe
- Internal server error
details:
$ref: '#/components/schemas/AccountPocketBaseFieldErrors'
description: 'Only with `Failed to subscribe`: PocketBase `response.data` of the failed call; omitted when PocketBase returned no data.'
WaitlistRequest:
type: object
required:
- email
properties:
email:
type: string
description: Trimmed and lowercased server-side (`trim().toLowerCase()`); must then match `^[^\s@]+@[^\s@]+\.[^\s@]+$`. A non-string value is treated as missing.
platform:
type: string
enum:
- android
- ios
default: android
description: Any other value is stored as android.
locale:
type: string
description: Truncated to 8 characters; default empty string.
source:
type: string
default: homepage_card
description: Truncated to 64 characters.
WaitlistCreatedResponse:
type: object
description: Added to the waitlist.
required:
- success
- message
additionalProperties: false
properties:
success:
const: true
message:
const: You are on the waitlist
AccountPocketBaseFieldErrors:
type: object
description: PocketBase validation errors keyed by field name (`response.data` of the failed PocketBase call).
additionalProperties:
$ref: '#/components/schemas/AccountPocketBaseFieldError'
NewsletterSubscribeRequest:
type: object
required:
- email
properties:
email:
type: string
description: Trimmed server-side (not lowercased); must then be at most 254 characters and match `^[^\s@]+@[^\s@]+\.[^\s@]+$`.
source:
type: string
default: landing_page
description: 'Sign-up origin stored as `newsletter_source`; not validated. Values sent by the web app: `landing_page` (homepage form), `blog_end` (box under every blog post).'
WaitlistBadRequest:
type: object
description: Email invalid.
required:
- error
additionalProperties: false
properties:
error:
const: A valid email is required
TestersServerError:
type: object
description: PocketBase failure or unreadable body.
required:
- error
additionalProperties: false
properties:
error:
type: string
enum:
- Failed to sign up
- Internal server error
details:
$ref: '#/components/schemas/AccountPocketBaseFieldErrors'
description: 'Only with `Failed to sign up`: PocketBase `response.data` of the failed call; omitted when PocketBase returned no data.'
NewsletterSubscribeCreatedResponse:
type: object
description: Account created; the PocketBase verification email was requested.
required:
- success
- message
- needsVerification
additionalProperties: false
properties:
success:
const: true
message:
const: Please check your email to verify your subscription
needsVerification:
const: true
AuthVerifyEmailResponse:
type: object
description: Email address verified.
required:
- success
- message
additionalProperties: false
properties:
success:
const: true
message:
const: Email verified successfully
AuthEmailStatusResponse:
description: '`new`: no account with this email. `password`: password account, or the lookup failed. `oauth`: the account is linked to the listed social providers.'
oneOf:
- $ref: '#/components/schemas/AuthEmailStatusBasicResponse'
- $ref: '#/components/schemas/AuthEmailStatusOAuthResponse'
TestersExistingResponse:
type: object
description: Already on the tester list for this platform.
required:
- success
- message
- isExisting
additionalProperties: false
properties:
success:
const: true
message:
const: Already on the tester list
isExisting:
const: true
TestersCreatedResponse:
type: object
description: Added to the tester list.
required:
- success
- message
additionalProperties: false
properties:
success:
const: true
message:
const: You are on the tester list
WaitlistServerError:
type: object
description: PocketBase failure or unreadable body.
required:
- error
additionalProperties: false
properties:
error:
type: string
enum:
- Failed to sign up
- Internal server error
details:
$ref: '#/components/schemas/AccountPocketBaseFieldErrors'
description: 'Only with `Failed to sign up`: PocketBase `response.data` of the failed call; omitted when PocketBase returned no data.'
AuthEmailStatusOAuthResponse:
type: object
description: Account linked to at least one social provider; steer the user to the provider button.
required:
- status
- providers
additionalProperties: false
properties:
status:
const: oauth
providers:
type: array
minItems: 1
items:
type: string
enum:
- google
- apple
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.'