API reference

Close tasks

The checklist each month's close works through, and its sign-offs.

Guides: Close the month

List the close checklist's tasks

GET/v1/close_tasks

client.closeTasks.list()

The tasks every month's close asks for, in the order they were written — which is the order a month's checklist lists them in.

Parameters

NameTypeDescription
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200CloseTaskPage

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/close_tasks" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Add a task to the close checklist

POST/v1/close_tasks· Idempotent

client.closeTasks.create()

Add a task to the close checklist. Every open month's close asks for it from now on, and none of them can close until it is signed off (or the close is forced) when it blocks. Closed months are not changed.

Request body

NewCloseTask

Response

201CloseTaskOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X POST "https://api.ledgerit.ai/v1/close_tasks" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"title":"…"}'

Get a close task

GET/v1/close_tasks/{task_id}

client.closeTasks.get()

One task of the close checklist.

Parameters

NameTypeDescription
task_idPath · Requiredstring

An id that starts with task_.

Response

200CloseTaskOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/close_tasks/{task_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Change a close task

PATCH/v1/close_tasks/{task_id}· Idempotent

client.closeTasks.update()

Change a task: rename it, hand it to someone else, move its due day, say whether the close waits on it or what it is done after. Every open month's close changes with it; a closed month keeps the task as it was.

Parameters

NameTypeDescription
task_idPath · Requiredstring

An id that starts with task_.

Request body

CloseTaskChanges

Response

200CloseTaskOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X PATCH "https://api.ledgerit.ai/v1/close_tasks/{task_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Remove a task from the close checklist

DELETE/v1/close_tasks/{task_id}

client.closeTasks.delete()

Remove a task from the checklist and from every open month's close, sign-off and all. A closed month's record of it stays, under the title it had.

Parameters

NameTypeDescription
task_idPath · Requiredstring

An id that starts with task_.

Response

204No content

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X DELETE "https://api.ledgerit.ai/v1/close_tasks/{task_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Sign a close task off for a month

POST/v1/periods/{key}/close_tasks/{task_id}/sign_off

client.closeTasks.signOff()

Sign a task off for one month, on the record, starting the month's close run if it has none. Safe to repeat: a task already signed off keeps its first sign-off. Refused with close_task_waiting while a task it is done after is not signed off, and with period_closed once the month is closed.

Parameters

NameTypeDescription
keyPath · Requiredstring
task_idPath · Requiredstring

An id that starts with task_.

Request body

SignOffRequest

Response

200ChecklistItemOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X POST "https://api.ledgerit.ai/v1/periods/{key}/close_tasks/{task_id}/sign_off" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Take back a close task's sign-off for a month

DELETE/v1/periods/{key}/close_tasks/{task_id}/sign_off

client.closeTasks.undoSignOff()

Take back a task's sign-off for one month, on the record. Refused with close_task_waiting while a task done after it is signed off, and with period_closed once the month is closed; reopen it first.

Parameters

NameTypeDescription
keyPath · Requiredstring
task_idPath · Requiredstring

An id that starts with task_.

Response

204No content

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X DELETE "https://api.ledgerit.ai/v1/periods/{key}/close_tasks/{task_id}/sign_off" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Objects

The objects these operations take and return.

CloseTaskPage

NameTypeDescription
dataRequiredarray of CloseTaskOut
has_moreRequiredboolean
next_cursorRequiredstring or null

NewCloseTask

NameTypeDescription
assignee_idstring or null

An id that starts with usr_.

blockingboolean

Whether a month's close waits on it. Defaults to true.

Default true
depends_on_idsarray of string

Tasks of these books it waits on: it is not signed off for a month until they are.

detailsstring or null

How to do it, or where to look.

due_daysinteger or null

Due this many days after each month ends. Omit for no due day.

titleRequiredstring

What has to be done, in a line.

CloseTaskOut

NameTypeDescription
assignee_emailRequiredstring or null

The owner's address in these books, when there is an owner.

assignee_idRequiredstring or null

An id that starts with usr_.

blockingRequiredboolean

Whether a month's close waits on it. A task that does not block can be left undone when the month closes.

created_atRequiredstring (date-time)

When the task was written.

depends_on_idsRequiredarray of string

The tasks it waits on: it is not signed off for a month until they are (decision 0089).

detailsRequiredstring or null

How to do it, or where to look, when there is more to say.

due_daysRequiredinteger or null

Due this many days after each month ends (0 is the last day). Null for no due day.

idRequiredstring

The task's id.

titleRequiredstring

What has to be done, in a line: “Book the payroll accrual”.

CloseTaskChanges

Only the fields sent change. details, assignee_id and due_days are cleared by sending null; title and blocking cannot be.

NameTypeDescription
assignee_idstring or null

An id that starts with usr_.

blockingboolean

Whether a month's close waits on it.

depends_on_idsarray of string or null

The tasks it waits on, all of them: an empty list waits on none.

detailsstring or null

How to do it; null clears it.

due_daysinteger or null

Due this many days after each month ends; null for no due day.

titlestring

What has to be done, in a line.

SignOffRequest

NameTypeDescription
notestring or null

Anything worth keeping beside the sign-off: where the evidence is.

ChecklistItemOut

One task as one month's close asks for it.

NameTypeDescription
assignee_emailRequiredstring or null

The owner's address in these books, when there is an owner.

assignee_idRequiredstring or null

An id that starts with usr_.

blockingRequiredboolean

Whether the month's close waits on it.

close_task_idRequiredstring or null

An id that starts with run_task_.

depends_on_idsRequiredarray of string

The tasks it waits on, by task_id.

detailsRequiredstring or null

How to do it, when the task says.

due_daysRequiredinteger or null

The task's due day, in days after each month ends, or null.

due_onRequiredstring (date) or null

The day it falls due for this month, or null for no due day.

is_overdueRequiredboolean

Not signed off, and its due day has passed.

noteRequiredstring or null

What the person who signed it off wrote beside it: the evidence.

signed_offRequiredboolean

Whether it is signed off for this month.

signed_off_atRequiredstring (date-time) or null

When it was signed off.

signed_off_byRequiredstring or null

An id that starts with usr_.

signed_off_by_emailRequiredstring or null

The address of whoever signed it off, while they are a member of these books.

task_idRequiredstring or null

An id that starts with task_.

titleRequiredstring

The task's title; on a closed month, as it stood when the month closed.

waits_on_idsRequiredarray of string

Of those, the ones not yet signed off this month: until they are, it cannot be.