Invoices API
All examples use:
https://app.keito.ai/api/v2
Add Authorization: Bearer <kto_...> and Keito-Account-Id: <company_id> to every API key request.
Creating, updating and sending invoices requires the relevant manager or administrator permissions. Recording payments also requires permission to manage invoices. Deleting requires an administrator, and only draft invoices can be deleted. An API key acts with the current permissions of the identity it is bound to: personal keys act as their creator, while administrators can issue integration keys bound to another identity. The key never inherits extra permissions from an administrator who issued it. See Authentication.
Create an Invoice from Tracked Time
POST /api/v2/invoices
The most common billing workflow: turn a period’s billable time and expenses into a draft invoice in a single call. Pass line_items_import and Keito builds the line items for you, applying each project’s billing rates, your workspace’s time-rounding rules, and your approval policy.
Only billable, not-yet-invoiced work is included. Everything imported is marked as billed, so the same hours cannot be invoiced twice.
This mirrors Harvest’s line_items_import, so an existing Harvest integration ports across with minimal changes.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
client_id |
string | Yes | Client ID |
line_items_import |
object | Yes | Import specification, described below |
number |
string | No | Requested final invoice number. Keito holds it separately while the invoice is a draft, revalidates it when the invoice is issued, and then makes it the invoice’s number. It must be unique in the workspace at issue time. |
subject |
string | No | Invoice subject |
issue_date |
string | No | YYYY-MM-DD, defaults to today |
due_date |
string | No | YYYY-MM-DD; an explicit date is preserved, otherwise calculated from the effective payment term and issue date |
payment_term |
string | No | upon_receipt, net_15, net_30, net_45, net_60, or custom; defaults to the client’s term, then workspace invoice settings, then net_30 |
currency |
string | No | Three-letter code, defaults to the workspace currency |
purchase_order |
string | No | PO number |
tax |
number | No | Percentage applied to the subtotal |
tax2 |
number | No | Second tax percentage |
discount |
number | No | Discount percentage |
notes |
string | No | Notes shown on the invoice |
When due_date is omitted, Keito adds the effective term’s days to issue_date: 0 for upon_receipt, or 15, 30, 45 or 60 for the corresponding net term. For custom, days come from the client if its own term is custom, otherwise from workspace settings if its default term is custom, otherwise 30. These defaults also apply when creating explicit line items.
line_items_import
| Field | Type | Required | Description |
|---|---|---|---|
project_ids |
string[] | No | Restrict the import to these projects. Omit for all of the client’s projects. |
time |
object | No | Import tracked time |
expenses |
object | No | Import expenses |
fail_if_empty |
boolean | No | Default false. Set true to return 422 without creating an invoice when no uninvoiced billable time or expenses match. |
At least one of time or expenses is required.
Each of time and expenses accepts:
| Field | Type | Required | Description |
|---|---|---|---|
summary_type |
string | Yes | How the work is grouped into line items |
from |
string | No | YYYY-MM-DD. Defaults to the earliest uninvoiced record. |
to |
string | No | YYYY-MM-DD. Defaults to the latest uninvoiced record. |
summary_type for time is project, task, people, or detailed. For expenses it is project, category, people, or detailed. detailed creates one line item per record.
Omit from and to to invoice all outstanding work regardless of date.
Example Request
curl -X POST https://app.keito.ai/api/v2/invoices \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id" \
-H "Content-Type: application/json" \
-d '{
"client_id": "client_id_here",
"number": "MS-2026-08",
"subject": "August 2026 services",
"issue_date": "2026-08-22",
"due_date": "2026-09-21",
"line_items_import": {
"project_ids": ["project_id_here"],
"time": {
"summary_type": "task",
"from": "2026-08-01",
"to": "2026-08-21"
},
"expenses": {
"summary_type": "category",
"from": "2026-08-01",
"to": "2026-08-21"
}
}
}'
The response is the created invoice, including the generated line_items and
their IDs. A new draft’s number is a provisional DRAFT-<UUID> reference,
even when the request included a requested final number. Keito assigns the
final sequential or requested number only when the draft is issued. Do not
export the provisional value to an accounting system as the final invoice
number.
Keep the line-item IDs when the integration needs to clean up the client-facing descriptions or rates before sending:
{
"id": "invoice_id_here",
"number": "DRAFT-123e4567-e89b-12d3-a456-426614174000",
"state": "draft",
"line_items": [
{
"id": "line_item_id_here",
"kind": "SERVICE",
"description": "Project: Task (01/08/2026 - 21/08/2026)",
"quantity": 8,
"unit_price": 125,
"amount": 1000
}
]
}
If the import fails, no invoice is left behind — Keito removes the draft before returning the error.
With fail_if_empty omitted or false, a valid import with no matching work still creates an empty draft. Use true when an automation should stop instead. An explicit line item’s project_id must belong to the invoice’s client and workspace; a mismatch returns 404 without creating an invoice.
Create an Invoice with Explicit Line Items
POST /api/v2/invoices
To calculate amounts yourself, pass line_items instead. line_items and line_items_import are mutually exclusive; sending both returns 400.
Line Item Fields
| Field | Type | Required | Description |
|---|---|---|---|
kind |
string | No | Item category, defaults to Service |
description |
string | No | Line description |
quantity |
number | No | Defaults to 1. Must be non-negative. |
unit_price |
number | No | Defaults to 0. Must be non-negative. |
effect |
string | No | charge or credit, defaults to charge |
taxed |
boolean | No | Apply the first tax rate |
taxed2 |
boolean | No | Apply the second tax rate |
project_id |
string | No | Attribute the line to a project |
sort_order |
number | No | Display order, defaults to array position |
Use "effect": "credit" for credit lines rather than negative numbers.
Invoice reads can also describe issued credit notes. Check document_type (invoice or credit_note) and credit_settlement rather than inferring the document kind from its amount. The credit settlement describes how an issued credit was applied or refunded; these read fields do not authorize creating or settling credit notes through this endpoint. See the downloadable schema for the exact settlement object.
Line items supplied this way are not linked to time entries or expenses, so the underlying work is not marked as billed.
Example Request
curl -X POST https://app.keito.ai/api/v2/invoices \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id" \
-H "Content-Type: application/json" \
-d '{
"client_id": "client_id_here",
"subject": "Consulting retainer",
"line_items": [
{
"kind": "Service",
"description": "Retainer - March",
"quantity": 1,
"unit_price": 4000,
"project_id": "project_id_here"
},
{
"kind": "Service",
"description": "Goodwill credit",
"quantity": 1,
"unit_price": 250,
"effect": "credit"
}
]
}'
List Invoices
GET /api/v2/invoices
Query Parameters
| Parameter | Type | Description |
|---|---|---|
client_id |
string | Filter by client |
state |
string | draft, open, paid, closed, or voided |
from |
string | Issue date lower bound (YYYY-MM-DD) |
to |
string | Issue date upper bound (YYYY-MM-DD) |
updated_since |
string | ISO timestamp lower bound |
page |
number | Page number, starting at 1 |
per_page |
number | Results per page, default 100, max 2000 |
Results are returned under an invoices key alongside page, per_page, total_pages, total_entries, and links.
Example Request
curl "https://app.keito.ai/api/v2/invoices?state=open&from=2026-01-01" \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id"
Scheduled Accounting Export
An accounting integration can poll this endpoint on a schedule using a rolling
from and to issue-date window and an invoice state. The state
parameter accepts one value per request; poll separate states when the
integration needs more than one. Follow the response’s pagination links until
links.next is null.
Each listed invoice includes the same invoice and line-item fields returned by the item endpoint:
| Field | Description |
|---|---|
id |
Stable Keito invoice ID |
client_id |
Client ID for the related client lookup |
client |
Embedded client ID and name |
number |
Invoice number |
state |
Current invoice state |
issue_date |
Invoice issue date |
due_date |
Invoice due date |
currency |
Three-letter currency code |
amount |
Total invoice amount |
due_amount |
Remaining unpaid amount |
line_items |
Ordered invoice lines |
updated_at |
Last update timestamp |
Each entry in line_items includes id, kind, description,
quantity, unit_price, amount, effect, taxed, taxed2,
project_id, and sort_order. The kind value is the invoice item
category used on that line and can be mapped directly to an accounting-system
article or category.
Use GET /api/v2/clients/:client_id when the destination also needs client
details. The response includes id, name, address, currency,
payment terms, tax settings, and discount. address is a single free-form
postal-address field rather than separate street, city, and postal-code fields.
Get an Invoice
GET /api/v2/invoices/:id
Returns the invoice with its client, creator, and line items.
Record an Invoice Payment
POST /api/v2/invoices/:id/payments
Records a partial or full payment against a non-draft invoice. A payment equal
to the remaining due_amount marks an open invoice as paid; a smaller payment
leaves it open. Payments must be positive and cannot exceed the amount due.
This endpoint requires a manager or administrator with permission to manage invoices.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
amount |
number | Yes | Payment amount, up to the invoice’s current due_amount |
paid_at |
string | No | ISO 8601 timestamp with an offset; defaults to the current time |
notes |
string | No | Optional payment notes |
transaction_id |
string | No | External payment or transaction reference |
payment_gateway |
string | No | Name of the originating system, such as Fortnox |
send_thank_you |
boolean | No | Overrides the workspace’s automatic thank-you setting |
Use an Idempotency-Key header when importing a payment so a retried request
cannot record the same payment twice. Set send_thank_you to false when
the connector should never send customer email.
curl --fail-with-body -X POST \
https://app.keito.ai/api/v2/invoices/invoice_id_here/payments \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: fortnox-payment-FTX-2026-000123" \
-d '{
"amount": 1250,
"paid_at": "2026-09-06T10:30:00+02:00",
"transaction_id": "FTX-2026-000123",
"payment_gateway": "Fortnox",
"send_thank_you": false
}'
A successful request returns 201 Created with the recorded payment,
including its id, invoice_id, amount, payment dates, external
reference, payment gateway, and the resulting accounting-sync status.
List and remove recorded payments
GET /api/v2/invoices/{id}/payments
Returns a paginated payments array, newest first by payment date and then recorded time. Each row includes deletable: true only for a manually recorded payment that is not linked to a payment from Xero and whose caller may manage invoices. Reading requires current invoice-view authority. The list is advertised through invoice-payments-list in X-Keito-Features.
DELETE /api/v2/invoices/{id}/payments/{paymentId}
Removal requires current invoice-management authority and applies only to manually recorded payments. Gateway, accounting-origin and retainer payments must be reversed through their originating workflow. The payment must belong to both the selected invoice and workspace.
Keito first requests any necessary Xero or QuickBooks reversal. Check the response’s deleted, outcome and accounting_sync fields: HTTP success can mean outcome: "kept_in_keito" when the accounting reversal is unconfirmed. Do not treat that as a completed deletion. When a deletion completes, invoice state and amount due are recalculated from remaining payments. Use an Idempotency-Key and retain the result; a kept payment may be deliberately retried after the provider issue is resolved.
Invoice attachments
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/api/v2/invoices/{id}/attachments |
List permitted invoice attachments |
POST |
/api/v2/invoices/{id}/attachments |
Upload a multipart file |
DELETE |
/api/v2/invoices/{id}/attachments?attachment_id={attachmentId} |
Remove a permitted attachment |
GET |
/api/v2/invoices/{id}/attachments/{attachmentId}/download |
Download private file bytes |
Adding/removing attachments requires the same authority as the web app, and an invoice in draft or open state. A file is limited to 9 MiB, with at most 10 files and 50 MiB total per invoice. Supported types are PDF, JPEG, PNG, GIF, WebP, Word, Excel, CSV and plain text. The send workflow has a separate combined email attachment budget; a stored file is not proof it was emailed.
curl --fail-with-body 'https://app.keito.ai/api/v2/invoices/YOUR_INVOICE_ID/attachments' \
-H "Authorization: Bearer $KEITO_API_KEY" \
-H "Keito-Account-Id: $KEITO_ACCOUNT_ID" \
-F 'file=@/path/to/supporting-document.pdf;type=application/pdf'
The client sets the multipart boundary. Do not send a JSON content type for upload. Expense receipt snapshots, manually uploaded files and generated reports are distinct attachment sources; sending uses the explicit attachment options documented below.
Update an Invoice
PATCH /api/v2/invoices/:id
Only draft invoices can be updated. Invoice-level fields include number,
subject, issue_date, due_date, purchase_order, tax, tax2,
discount, notes, period_start, period_end, service_period_start, and
service_period_end.
curl -X PATCH https://app.keito.ai/api/v2/invoices/invoice_id_here \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id" \
-H "Content-Type: application/json" \
-d '{ "due_date": "2026-05-15", "notes": "Payment by bank transfer" }'
Edit Imported Line Items
Patch imported lines in place by supplying the line item id from the create
or get-invoice response and any of description, unit_price, or kind:
curl --fail-with-body -X PATCH \
https://app.keito.ai/api/v2/invoices/invoice_id_here \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id" \
-H "Content-Type: application/json" \
-d '{
"line_items": [
{
"id": "line_item_id_here",
"description": "Consulting services",
"unit_price": 150,
"kind": "Service"
}
]
}'
Keito updates the existing line and recalculates invoice totals. The links to its imported time entries or expenses are preserved, so those source records remain billed and cannot be selected again next month.
Every object must include an ID belonging to the invoice. This endpoint does
not accept a full replacement array, line_items_attributes, a new line without
an ID, or a nested /line_items/:id route.
Download an Invoice PDF
GET /api/v2/invoices/:id/pdf
Download the invoice exactly as it is currently rendered in Keito:
curl --fail --output "MS-2026-08.pdf" \
https://app.keito.ai/api/v2/invoices/invoice_id_here/pdf \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id"
A successful response has Content-Type: application/pdf and a
Content-Disposition filename. The response is private and is not cached. The
API key must have access to the invoice’s workspace; invoices in another
workspace return 404.
Validation and Billed State
Invoice create and update requests reject unsupported fields with 400 Bad Request instead of returning a false success. The response message identifies
the unsupported field.
Billing flags are server-owned. Do not PATCH is_billed on time entries or
expenses. Create the invoice with line_items_import to mark source work as
billed; deleting the draft releases eligible source records through the invoice
workflow.
Clients can detect the new behavior in the X-Keito-Features response header:
invoice-line-item-edit,invoice-payments,invoice-pdf
Delete an Invoice
DELETE /api/v2/invoices/:id
Administrators only, and only for draft invoices. Deleting a draft releases the time entries and expenses it captured, so they become invoiceable again.
Send or mark an invoice as sent
POST /api/v2/invoices/:id/messages
Use this endpoint to send an invoice email, issue a draft without emailing anyone, resend an issued invoice, send a reminder, or send a payment thank-you.
For an integration that delivers the invoice through another system, use
event_type: "mark_sent". This issues an eligible draft: it atomically assigns
the draft’s final sequential or requested number once, moves it from draft
to open, records it as sent with no recipients, and does not send an email.
It follows the same issue path as a normal send, including configured Xero
auto-sync. It is not for an invoice that is already issued; a second
mark_sent on an open, paid, or closed invoice is refused. To email the
invoice yourself afterwards, follow the own-inbox workflow.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
event_type |
string | No | send, mark_sent, resend, reminder, or thank_you. Defaults to send. |
recipients |
array | Conditional | Objects with email and optional name. Recipients are required only for email events; omit them for mark_sent. |
cc_recipients |
array | No | Objects with email and optional name |
subject |
string | No | Email subject |
body |
string | No | Email body |
attach_pdf |
boolean | No | Attach the invoice PDF, defaults to true |
attach_expense_receipts |
boolean | No | Include expense receipts, defaults to true |
include_attachments |
boolean | No | Include uploaded invoice files and generated time reports, defaults to true |
send_me_a_copy |
boolean | No | Copy the identity the key is bound to |
confirm |
object | No | The invoice amount and three-letter currency the integration expects; optionally include the distinct recipient_count. A mismatch returns 409 before the invoice changes. Use recipient_count: 0 for mark_sent. |
expected_sender |
object or null | No | The sender you previewed: mode (STANDARD or CUSTOM) and from_email, with optional sender_version. Applies to email events; ignored for mark_sent. |
Use send for the first emailed delivery, resend for another copy of an open
or paid invoice, reminder to chase an outstanding invoice, and thank_you
once it is paid. Thank-you messages do not accept CC recipients.
Use an Idempotency-Key header for every issuing integration request. The key
must contain 8–255 letters, numbers, dots, underscores, or hyphens. An identical
retry with the same key replays the stored response for 24 hours; reusing the
key with a different request returns 409. If a request times out or returns an
unresolved idempotency error, read the invoice before starting a new attempt.
Sender and Delivery Refusals
expected_sender binds an email request to the sender your integration previewed. from_email is compared case-insensitively. No API endpoint currently exposes sender_version, so omit it unless you already have an authorized value; mode and address are then compared. Extra fields, invalid addresses and unknown modes return 400 before work starts.
If the resolved sender changed, 400 sender_configuration_changed includes a typed reason and support reference; refresh the preview. If a custom sender is held, such as stale domain checks or paused sending, 400 invoice_email_held includes the reason and reference. For send and reminder, the initial check runs before issuance or reminder recording, so a refusal issues and sends nothing and releases the idempotency key. A held refusal records send_held in invoice activity. The sender is checked again immediately before email submission.
400 invoice_email_outcome_unknown with reason: PROVIDER_OUTCOME_UNKNOWN means the provider did not confirm the outcome and the email may already have been delivered. Check delivery status and owner review before sending again; Keito does not resend automatically. For send, resend and thank_you, that result is retained and replayed for the same idempotency key. Another delivery that is still pending or awaiting review returns 409 invoice_delivery_unresolved.
A completed idempotent request replays its stored answer without rechecking a newly held sender or delivery fence. A refused request releases its key; an in-progress request with the same key returns 409. Unexpected server errors carry a generic message and reference.
Example Request
curl -X POST https://app.keito.ai/api/v2/invoices/invoice_id_here/messages \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id" \
-H "Content-Type: application/json" \
-d '{
"event_type": "send",
"recipients": [{ "name": "Accounts", "email": "accounts@example.com" }],
"subject": "Invoice for March 2026",
"body": "Please find March'"'"'s invoice attached.",
"attach_pdf": true
}'
Mark as sent without email
This is the integration flow for assigning the final number before exporting the invoice to another system:
curl --fail-with-body -X POST \
https://app.keito.ai/api/v2/invoices/invoice_id_here/messages \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: issue-invoice-invoice_id_here" \
-d '{
"event_type": "mark_sent",
"confirm": {
"amount": 1000,
"currency": "AUD",
"recipient_count": 0
}
}'
The POST response is the new invoice-message record, not a refreshed invoice. After it succeeds, fetch the invoice and export only the returned final number:
curl --fail \
https://app.keito.ai/api/v2/invoices/invoice_id_here \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id"
Confirm that the response has state: "open" and that number is the final
sequential or requested number rather than a provisional DRAFT-… reference.
If the POST outcome was uncertain, perform this GET before retrying or exporting.
Own-inbox workflow
Some teams email invoices from their own mailbox so the message comes from their own domain. Keito supports this with three API calls and never sends the email itself:
- Issue without emailing.
POST /api/v2/invoices/:id/messageswithevent_type: "mark_sent"and anIdempotency-Key, as shown above. This issues an eligible draft, assigns its final number once, and records it as sent with no recipients. It sends no email and is not for an invoice that is already issued. - Fetch the public link.
GET /api/v2/invoices/:id/public-linkreturns the same link the Send dialog and Keito’s own invoice emails carry. - Send from your own mailbox. Put the link, and optionally the PDF from
GET /api/v2/invoices/:id/pdf, in an email you send yourself. - Record the delivery (optional).
POST /api/v2/invoices/:id/external-deliveriesadds an external-delivery event to the invoice history and sets its first-sent date, so the history in Keito matches what the client received.
Keito does not coordinate or observe the external send. If your email fails,
retry the external send with the link you already hold. Do not issue the
invoice again: it is already open with its final number, and a second
mark_sent is refused.
Get the public invoice link
GET /api/v2/invoices/:id/public-link
Returns the public invoice URL so you can include it in an email you send from your own mailbox. Keito sends no email, creates no payment session, and does not change the invoice. The retrieval is audited; the audit entry does not contain the URL.
The URL is a bearer link, so this endpoint is gated like sending, not like
reading: owners and administrators always, managers only with permission to
manage invoices, and AI app connections with can_send_invoices. Plain
invoice-view permission and personal read-only sync keys are refused with
403.
Response
| Field | Description |
|---|---|
invoice_id |
Invoice ID |
public_url |
Absolute URL of the public invoice page, or null while the invoice cannot be shared |
visibility |
shareable or unavailable |
visibility_reason |
INVOICE_NOT_ISSUED for a draft (issue it first with mark_sent), INVOICE_NOT_SHAREABLE for a voided invoice, otherwise null |
payment |
Point-in-time online payment eligibility, described below |
Open, paid, and closed invoices are shareable.
payment is advice from the same resolver the public page and its pay button
use: available, the active providers (stripe, paypal), the methods
the link offers (card, ach, paypal), the resolver’s blocked_reasons
verbatim, and checked_at. Blocked reasons are not_open, paid, voided,
stripe_inactive, paypal_inactive, paypal_feature_disabled,
unsupported_currency, and no_payment_methods. When available is false,
every method is false even if the workspace has it configured. A paid
invoice reports not_open; paid means an open invoice with nothing left to
pay. The payer’s click re-checks eligibility, so a stale available: true is
never honoured.
curl https://app.keito.ai/api/v2/invoices/invoice_id_here/public-link \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id"
{
"invoice_id": "invoice_id_here",
"public_url": "https://app.keito.ai/invoice/<opaque-client-key>",
"visibility": "shareable",
"visibility_reason": null,
"payment": {
"available": true,
"providers": ["stripe"],
"methods": { "card": true, "ach": false, "paypal": false },
"blocked_reasons": [],
"checked_at": "2026-11-03T10:00:00Z"
}
}
Anyone holding public_url can open the invoice and, when eligible, pay it
online, so treat it as a credential to financial information. The response is
Cache-Control: private, no-store: do not cache it, keep it out of logs and
error reports, and fetch it again rather than storing it. Keito never returns
it in invoice lists or writes it to the audit trail.
Record an external delivery
POST /api/v2/invoices/:id/external-deliveries
Records that an issued invoice went out from your own mailbox, by post, or in
person. This is bookkeeping only: it appends an external_delivery event to
the invoice history and sets the invoice’s first-sent date if it had none. It
requires the same permission as the public link.
It never issues a draft, assigns a number, sends an email, creates a payment
session, changes the balance, restarts reminders, or syncs accounting. To
issue a draft, use mark_sent first.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
sent_on |
string | No | YYYY-MM-DD. Defaults to today in the workspace timezone. Cannot be in the future or earlier than the invoice’s issue date. |
The body must be JSON and accepts no other fields.
Outcomes
| HTTP | status |
reason |
|---|---|---|
201 |
recorded |
null; a delivery event was appended |
200 |
skipped |
draft (issue it with mark_sent first), voided, retainer_unsent (an unsent retainer funding invoice keeps its own send flow), date_before_issue, or already_recorded (the latest delivery event already carries that date) |
Both responses also return invoice_id and sent_on, the date recorded or
already present. A 200 means nothing changed; there is nothing to retry.
Send an Idempotency-Key with every request. An identical retry replays the
stored response for 24 hours. The same key with a different body, or reused on
another invoice, returns 409. Validation and the ownership check run before
the key is claimed, so a refused request never consumes it. Recording runs
under a per-invoice lock: two same-day requests with different keys produce
one recorded and one skipped with already_recorded.
curl --fail-with-body -X POST \
https://app.keito.ai/api/v2/invoices/invoice_id_here/external-deliveries \
-H "Authorization: Bearer kto_xxxxx" \
-H "Keito-Account-Id: your_company_id" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: external-delivery-invoice_id_here-2026-11-03" \
-d '{ "sent_on": "2026-11-03" }'
{
"invoice_id": "invoice_id_here",
"status": "recorded",
"reason": null,
"sent_on": "2026-11-03"
}
List Invoice Messages
GET /api/v2/invoices/:id/messages
Returns the send, resend, external-delivery, reminder, and thank-you history for
an invoice under an invoice_messages key. A successful mark_sent action is
recorded as a send event with no recipients; a recorded external delivery has
event_type: "external_delivery".
Not Yet Available
These exist in the Keito web app but are not yet exposed over the API:
- Adding new lines to, or removing lines from, an existing invoice
- Listing the workspace’s invoice item categories
If any of these are on your critical path, get in touch — customer demand sets the order we build them in.