Skip to main content
POST
Create a habit

Authorizations

Authorization
string
header
required

A pc_… token generated from Settings > API & MCP.

Body

application/json
name
string
required
Required string length: 1 - 200
rule
object
required

A habit's rule: the task's repeat grammar without a mode, phased on startsOn.

startsOn
string<date>
required

Local day key, YYYY-MM-DD.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
target
object
required

What one occurrence asks for: a tick, a quantity in a unit, or minutes.

Response

Created.

habit
object
required