Create an account

POST https://app.speybooks.com/api/v1/accounts/

Creates a new account in the chart of accounts. The account code must be unique within the organisation. If a parent account is specified, it must exist and share the same account type.

Account codes are free-form strings (max 20 characters) but by convention follow UK numbering: 1xxx for assets, 2xxx for liabilities, 3xxx for equity, 4xxx for revenue, 5xxx+ for expenses.

Body parameters

accountType string required
Account type. Immutable after creation.
assetliabilityequityrevenueexpense
code string required
Unique account code within the organisation (max 20 characters). By convention: 1xxx assets, 2xxx liabilities, 3xxx equity, 4xxx revenue, 5xxx expenses.
name string required
Display name (max 200 characters).
controlType string optional nullable
Control account type identifier (e.g. trade_debtors). Only relevant if isControlAccount is true.
defaultVatRate integer optional nullable
Default VAT rate as a whole percentage (e.g. 20 for 20%). Applied as suggestion when creating transaction lines.
description string optional nullable
Optional description of the account purpose (max 500 characters).
isActive boolean optional
Whether the account is active. Defaults to true.
isControlAccount boolean optional
Whether this is a control account (e.g. trade debtors). Defaults to false.
parentId string optional nullable
Prefixed ID of the parent account (e.g. acc_100). Parent must be the same account type.

Response

201 Created successfully. Returns the new account ID, code, and name.
Show response fields
code string
Account code as provided.
id string
Prefixed account ID (e.g. acc_4100).
name string
Account name as provided.

Error codes

400 Validation failed. Check error.details for field-level errors, or invalid parent account.
409 An account with this code already exists in the organisation.