Rules and playbooks

Read the rules and playbooks that shape postings in your workspace.


Rules and playbooks are how a workspace teaches AutoTally its habits. A key can read them. Changing them takes a person. For what they do, read Rules and playbooks. For conventions, read the API overview.

Rules

List rules

GET /v1/rules

Returns every live rule in the workspace. Show summary to people. rule.subject is a lookup key, not display text.

Response fields

Field Type Description
rules[] array of object Rules.
rules[].rule object The rule.
rules[].rule.id UUID Rule id.
rules[].rule.companyGuid string Company it applies to. Null means the whole workspace.
rules[].rule.userId UUID Person it applies to. Null means everyone.
rules[].rule.kind string Kind of rule. One of: party-ledger-map, party-fact, validation-threshold, workflow-note, company-account-map.
rules[].rule.subject string Normalised lookup key. Not for display: use subjectLabel.
rules[].rule.subjectLabel string The subject as a person wrote it.
rules[].rule.outcome object What the rule does. The shape depends on kind.
rules[].rule.learnedFrom string How it came to exist: a correction, a chat, or typed in by hand. One of: correction, chat, manual.
rules[].rule.learnedAt date-time When it was learned.
rules[].rule.verifiedBy string Who reviewed it. Null if nobody has.
rules[].rule.verifiedAt date-time When it was reviewed.
rules[].rule.status string deprecated means revoked. One of: draft, stable, deprecated.
rules[].rule.staleAfter date Date after which it should be reviewed.
rules[].rule.validFrom date First voucher date it applies to. Null means no start.
rules[].rule.validTo date Last voucher date it applies to. Null means no end.
rules[].rule.supersedes UUID The rule this one replaces.
rules[].rule.revokedAt date-time When a person revoked it.
rules[].rule.revokedBy string Who revoked it.
rules[].summary string What the rule does, in one sentence. Show this to people.
rules[].replacedBy object The live rule that replaced this one, or null.
rules[].replacedBy.ruleId UUID The rule.
rules[].replacedBy.kind string Kind of rule. One of: party-ledger-map, party-fact, validation-threshold, workflow-note, company-account-map.
rules[].replacedBy.subject string Normalised lookup key. Not for display.
rules[].replacedBy.summary string What the rule does, in one sentence.
rules[].replacedBy.learnedAt date-time When it was learned.
rules[].replacedBy.revokedAt date-time When it was revoked, if it was.
rules[].appliesAfterRevoke object What would apply if this rule were revoked now, or null.
rules[].appliesAfterRevoke.ruleId UUID The rule.
rules[].appliesAfterRevoke.kind string Kind of rule. One of: party-ledger-map, party-fact, validation-threshold, workflow-note, company-account-map.
rules[].appliesAfterRevoke.subject string Normalised lookup key. Not for display.
rules[].appliesAfterRevoke.summary string What the rule does, in one sentence.
rules[].appliesAfterRevoke.learnedAt date-time When it was learned.
rules[].appliesAfterRevoke.revokedAt date-time When it was revoked, if it was.

Status codes

Status Error Meaning
200 Success.
401 unauthorized The key is missing, invalid or revoked.

Example request

curl -s "https://relay.autotally.ai/v1/rules" \
  -H "authorization: Bearer $AUTOTALLY_TOKEN"

Export rules

GET /v1/rules/export

Downloads the rules as a ZIP of Markdown files, one per live rule, with a change log.

The response is a ZIP file.

Status codes

Status Error Meaning
200 Success.
401 unauthorized The key is missing, invalid or revoked.

Example request

curl -s "https://relay.autotally.ai/v1/rules/export" \
  -H "authorization: Bearer $AUTOTALLY_TOKEN" \
  -o rules.zip

Playbooks

List playbooks

GET /v1/playbooks

Returns your workspace's playbooks. Each is a written procedure for one shape of source document.

Parameters

Name In Type Required Description
includeDisabled Query string No Set to true to include switched-off playbooks. One of: true.

Response fields

Field Type Description
playbooks[] array of object Playbooks.
playbooks[].id UUID Playbook id.
playbooks[].companyGuid string Company it applies to. Null means the whole workspace.
playbooks[].slug string Its stable identifier.
playbooks[].title string Title.
playbooks[].whenToUse string One line on when it applies.
playbooks[].body string The procedure, in Markdown.
playbooks[].documentKind string Kind of document it applies to automatically. Null means by name only. One of: purchase-invoice, sales-invoice, bank-statement, receipt, other, bill-of-supply, proforma-invoice, purchase-order, delivery-challan, quotation, unknown.
playbooks[].status string disabled means switched off, not deleted. One of: active, disabled.
playbooks[].learnedFrom string How it was added. One of: manual, chat.
playbooks[].learnedAt date-time When it was added.
playbooks[].verifiedBy string Who vouched for the current text.
playbooks[].verifiedAt date-time When they did.
playbooks[].updatedAt date-time Last change.
playbooks[].revokedAt date-time When it was revoked.
playbooks[].revokedBy string Who revoked it.

Status codes

Status Error Meaning
200 Success.
401 unauthorized The key is missing, invalid or revoked.

Example request

curl -s "https://relay.autotally.ai/v1/playbooks" \
  -H "authorization: Bearer $AUTOTALLY_TOKEN"