Using Lockit
Lock durations and defaults
How Lockit decides when a lock ends, and how to set a shorter default.
Every lock has an end time. Lockit works it out in this order:
- The duration you give when locking, for example
/lockit lock resource:staging-db duration:2 hourson Discord. - The resource's default, if one is set.
- The workspace default, if one is set.
- 48 hours, if none of the above.
For resources that are in demand, set a shorter default so a forgotten lock frees up sooner.
Set a default for one resource
Send defaultLockDays, defaultLockHours and defaultLockMinutes to the
resource's default-duration endpoint. The three are added together, and any you
leave out count as zero.
curl -X POST \
-H "X-API-KEY: $LOCKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"defaultLockHours": 2}' \
https://api.lockitbot.com/api/locky/resources/staging-db/default-duration
Set a default for the whole workspace
This applies to every resource that doesn't have its own default.
curl -X POST \
-H "X-API-KEY: $LOCKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"defaultLockDays": 1}' \
https://api.lockitbot.com/api/locky/config/default-duration
Both calls need an API key with write scope. See API keys and the API reference.
Through the API, the lock call's own duration is in minutes: "duration": 60
is one hour.