PDND

Documentation

Let your tools do the remembering. With an access token, your calendar, an iOS Shortcut or a tiny script can start and end your PDND (Please, Do Not Disturb) sessions for you. Three endpoints, one header, no SDK.

Creating access tokens

Access tokens let external tools and scripts authenticate as you without your email and password. Each token acts on behalf of your account.

  1. Open the Developers page (also reachable from the user menu in the top-right corner).
  2. Under Create a new token, give the token a recognisable Name (e.g. Calendar automation).
  3. Optionally pick an Expiry. Tokens can last 30 days, 90 days, 1 year, or never expire.
  4. Click Create token.
  5. Copy the token immediately — the full secret is shown only once and cannot be retrieved again afterwards. Only a hash is stored on the server.

Tokens are prefixed with pdnd_. You can revoke a token at any time from the Developers page; revoked or expired tokens are rejected with a 401 response.

Authentication

Send your token as a bearer credential in the Authorization header on every API request:

Authorization: Bearer pdnd_your_token_here

Requests without a valid, unexpired token receive 401 Unauthorized. Errors are returned as JSON: { "error": "..." }.

API reference

All endpoints are rooted at /api/v1 and exchange JSON. A DND session represents a period during which you do not want to be disturbed.

GET/api/v1/dnd/status

Read your current DND state.

Response

{
  "active": true,
  "session": {
    "id": "…",
    "userId": "…",
    "startTime": 1717000000000,
    "endTime": 1717003600000,
    "status": "active"
  }
}

active accounts for natural expiry; when no session is active, session is null.

POST/api/v1/dnd/start

Start a DND session on behalf of the token owner.

Request body

{
  "durationMinutes": 60
}

durationMinutes is optional; omitting it or passing 0 starts an open-ended session.

Response

{ "session": { "id": "…", "status": "active", … } }
POST/api/v1/dnd/end

End your currently active DND session early. Responds 404 when there is no active session. No request body is required.

Response

{ "session": { "id": "…", "status": "ended", … } }

Example

Start a one-hour DND session with curl:

curl -X POST https://pleasednd.com/api/v1/dnd/start \
  -H "Authorization: Bearer pdnd_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{"durationMinutes": 60}'

Wrapped up early? End the session:

curl -X POST https://pleasednd.com/api/v1/dnd/end \
  -H "Authorization: Bearer pdnd_your_token_here"

Check where things stand:

curl https://pleasednd.com/api/v1/dnd/status \
  -H "Authorization: Bearer pdnd_your_token_here"

Ideas