Back to Docs

Manifest reference

Every field in prosaic.extension.toml — scopes, triggers, connections, validation.

The manifest is the contract between your extension and the platform. It declares who you are, what you can touch, and when you run. The runtime enforces every bit of it.

Shape

toml
#:schema https://developer.prosaic.works/schemas/extension-manifest.json
name = "my-extension"
version = "0.0.1"
description = "Optional one-liner"

[scopes]
required = ["read:transactions", "send:email"]

# At least one trigger block below is required.

[[targets.events]]
type = "journal.posted"

[targets.cron]
schedule = "0 9 * * *"

[[targets.actions]]
placement = "transaction.single"
label = "Analyse this transaction"

Validation in your editor

The first line points TOML editors at the manifest's JSON Schema:

toml
#:schema https://developer.prosaic.works/schemas/extension-manifest.json

Editors built on Taplo, such as the Even Better TOML extension for VS Code, read that line and check the file as you type: unknown scopes, misspelt event types, missing labels. prosaic extension init and the scaffold_extension MCP tool write it for you. To a TOML parser it is a comment, so the platform ignores it.

The schema is generated from the same lists the validator uses, so the editor and prosaic extension validate agree. You can fetch it directly at https://developer.prosaic.works/schemas/extension-manifest.json.

Top-level fields

FieldRequiredDescription
nameYesKebab-case by convention. Deploy finds the extension by this name, so keep it unique in your workspace.
versionYesAny string; semver recommended. Shown in Settings → Extensions.
descriptionNoFree-text. Appears alongside the name.

[scopes]

Declare every permission you need. Calling a method your manifest didn't authorise throws Permission denied: scope '…' is required to call prosaic.…. Start minimal — you can add more on the next deploy.

ScopeGrants access to
read:transactionsprosaic.transactions.list and .get
write:transactionsprosaic.transactions.update
read:journalsprosaic.journals.list and .get
read:entitiesprosaic.entities.list and .get
send:emailprosaic.email.send
use:aiprosaic.ai.complete (also extends execution timeout to 120s)
use:toolsprosaic.tools.list and .invoke
use:httpprosaic.http.fetch — outbound requests to a declared [[connections]] target
read:reportsprosaic.reports.list and .generate — profit & loss, balance sheet, trial balance and the other financial reports
read:gst-returnsprosaic.gst.list and .get — GST return status, periods and IRD box amounts

prosaic.storage.*, prosaic.links.* and prosaic.log.* need no scope — they're always available.

prosaic.tools.invoke checks two scopes: use:tools for the call itself, and the scope of the tool you invoke. accounts.list, the entity's chart of accounts, needs read:entities. See prosaic.tools.

Triggers

You need at least one. You can mix them — an extension can have events, a cron, and action links all at once.

[[targets.events]]

Runs when a domain event fires on an entity the extension is installed on. Multiple event blocks are fine.

toml
[[targets.events]]
type = "journal.posted"

[[targets.events]]
type = "transaction.reconciled"
Event typeFires wheninput payload
journal.createdA manual journal is created{ journalId: string, logicalJournalId: string }
journal.postedA journal is posted (becomes final){ journalId: string }
journal.voidedA journal is voided{ journalId: string, reversalJournalId: string }
transaction.reconciledA bank transaction is matched to a journal{ transactionId: string, journalId: string }
file.uploadedA file is uploaded to an entity{ fileId: string, filename: string }
gst.period.rolloverA new GST period starts (phase: 'started') or the previous period's return is finalised (phase: 'previous-finalised'){ phase: 'started' | 'previous-finalised', gstReturnId: string, periodStart: string, periodEnd: string, dueDate: string, gstPeriodMonths: 1 | 2 | 6, previousReturnId: string | null }
gst.return.finalisedA GST return is finalised (draft → finalised); its figures are locked{ gstReturnId: string, status: string, periodStart: string, periodEnd: string, dueDate: string, netGstPosition: string | null, isAmendment: boolean }
gst.return.reverted_to_draftA finalised or rejected GST return is reverted to draft{ gstReturnId: string, status: string, periodStart: string, periodEnd: string, dueDate: string, netGstPosition: string | null, isAmendment: boolean }
gst.return.filedA finalised GST return is filed with IRD (finalised → filed){ gstReturnId: string, status: string, periodStart: string, periodEnd: string, dueDate: string, netGstPosition: string | null, isAmendment: boolean }
gst.return.acceptedIRD accepts a filed GST return (filed → accepted){ gstReturnId: string, status: string, periodStart: string, periodEnd: string, dueDate: string, netGstPosition: string | null, isAmendment: boolean }
gst.return.rejectedIRD rejects a filed GST return (filed → rejected){ gstReturnId: string, status: string, periodStart: string, periodEnd: string, dueDate: string, netGstPosition: string | null, isAmendment: boolean, rejectionCode: string, rejectionMessage: string }
gst.return.awaiting_paymentAn accepted GST return has an outstanding IRD balance (accepted → awaiting_payment){ gstReturnId: string, status: string, periodStart: string, periodEnd: string, dueDate: string, netGstPosition: string | null, isAmendment: boolean, balance: string }
gst.return.completedA GST return reaches its end state — paid/settled (auto) or marked completed (manual){ gstReturnId: string, status: string, periodStart: string, periodEnd: string, dueDate: string, netGstPosition: string | null, isAmendment: boolean }

The payload arrives on prosaic.context.input, and prosaic.context.trigger is the event type.

[targets.cron]

Runs on a schedule. Standard 5-field Unix cron — minute, hour, day, month, weekday. All in UTC.

toml
[targets.cron]
schedule = "0 9 * * *"     # Every day at 09:00 UTC

Only one cron block per extension. It runs once per installation, so an extension installed on three entities runs three times. prosaic.context.trigger is "cron" and prosaic.context.input is empty.

Some common patterns:

ScheduleMeaning
*/15 * * * *Every 15 minutes
0 * * * *Every hour on the hour
0 9 * * *Daily at 09:00 UTC
0 9 * * 109:00 UTC every Monday
0 9 1 * *09:00 UTC on the 1st every month

[[targets.actions]]

Adds a button to the Prosaic UI. Users click it, your extension runs. Good for one-off bulk jobs or "look at this thing" actions.

toml
[[targets.actions]]
placement = "transaction.single"
label = "Categorise with AI"

[[targets.actions]]
placement = "transaction.bulk"
label = "Bulk categorise"
PlacementShows upinput payload
transaction.singleIn the detail view of a single transaction{ placement: "transaction.single", transactionId: string }
transaction.bulkOn the transaction list after multi-selecting rows{ placement: "transaction.bulk", transactionIds: string[] }
reportAbove the Profit and loss report{ placement: "report", reportType: "profit-loss", entityId: string, startDate: string, endDate: string }

label is the button text — keep it short. prosaic.context.trigger is "action.link".

[[connections]]

A connection declares a third-party API your extension calls with prosaic.http.fetch. Declaring one requires the use:http scope. A workspace admin connects it from the extension's page under Settings → Extensions, by entering the credential (or, for oauth2, the third party's client ID and secret, then authorising) — see Connect outside services. Prosaic stores the credential and attaches it to each request on the server, so your code never holds it.

toml
[scopes]
required = ["use:http", "read:transactions"]

[[connections]]
name = "acme"
label = "Acme CRM"
auth = "bearer"
base_url = "https://api.acme.example"
allowed_hosts = ["api.acme.example"]

[[connections.fields]]
key = "token"
label = "API token"
secret = true
FieldRequiredDescription
nameYesLowercase kebab-case, starting with a letter, up to 64 characters. You pass it to http.fetch.
labelYesShown to the admin who connects it.
descriptionNoShown alongside the label.
authYesbearer, basic, header or oauth2 — see below.
base_urlYesAn https:// URL. Request paths resolve against it.
allowed_hostsYesHosts requests may reach. *.example.com matches subdomains but not example.com itself. Must cover the base_url host.
scopeNoworkspace (the default) shares one credential across the workspace; entity keeps one per entity and uses the one for the run's entity, but can't be connected from Settings yet.
fieldsDepends[[connections.fields]] blocks, each with key and label, and optionally secret, required and placeholder.

What each auth strategy sends, and what it needs declared:

authSendsDeclare
bearerAuthorization: Bearer {token}A field with key = "token"
basicAuthorization: Basic base64(username:password)Fields username and password
headerA header you name, such as X-Api-Key: {api_key}[connections.header] with name and template; each {placeholder} must be a field key
oauth2Authorization: Bearer <access token>, refreshed[connections.oauth2] with authorize_url and token_url (optional scopes, pkce, audience); no fields. Both URLs' hosts must be in allowed_hosts

Validation

prosaic extension validate, prosaic extension deploy and the validate_extension_manifest MCP tool all run the same checks:

  • name and version are required.
  • Every scope must be one of the scopes listed above. Typos fail.
  • Every event type must be one of the events listed above.
  • Cron schedules must have exactly 5 fields.
  • Every action must have a valid placement and a non-empty label.
  • At least one of targets.events, targets.cron, or targets.actions is required — no trigger, no extension.
  • Every connection needs a valid name, a label, a known auth, an https base_url and at least one allowed host, and declaring any connection requires use:http.

When you deploy, Prosaic also checks each connection's strategy against its fields (a bearer connection without a token field is refused, for example) and that allowed_hosts covers every URL the connection uses.

Check locally before deploying:

bash
prosaic extension validate --dir .

Full example — AI categorisation suggestions

toml
#:schema https://developer.prosaic.works/schemas/extension-manifest.json
name = "categorisation-suggestions"
version = "0.1.0"
description = "Suggest accounts for selected transactions using AI"

[scopes]
required = [
  "read:transactions",
  "read:entities",
  "use:tools",
  "use:ai",
]

[[targets.actions]]
placement = "transaction.single"
label = "Suggest an account"

[[targets.actions]]
placement = "transaction.bulk"
label = "Suggest accounts"

Two buttons, four scopes. read:entities and use:tools together let it read the chart of accounts through prosaic.tools.invoke('accounts.list', {}). The handler is in Triggers.