PulseDeveloper
Pulse API

Writes and idempotency

Creating and updating time entries and clients safely.

What you can write

EndpointScopeNotes
POST /v1/time-entriestime_entries.writeDraft or Awaiting Review; never Approved
PATCH /v1/time-entries/{id}time_entries.writeApproved entries are locked
POST /v1/clientsclients.writeYou choose the clientId slug
PATCH /v1/clients/{id}clients.writeSlug or UUID in the path

Deleting, approving, rejecting, and billing stay in the app for now.

Who is the actor?

Writes run the same rules as the Pulse app, so they need to know who is acting.

CredentialTime entriesClients
API key (pulse_sk_…)POST requires userId: the team member whose time it is. PATCH acts as the entry's owner.The organization acts for itself.
OAuth client-credentials tokenSame as an API key.Same as an API key.
OAuth user-delegated tokenActs as the authorizing user. A userId that disagrees is a 400.Acts as the authorizing user, with their client-team access.

The credential's scope gates the endpoint; the user's permissions gate the action. If the team member cannot log time in the app, the API returns 403 even though your key holds time_entries.write.

Rules you will hit

Business-rule failures return 422 with error.code = "unprocessable" and the same message the app shows: locked dates and weeks, weekly hour caps, approved entries, missing task selection, exceeded budgets, inactive clients. Fix the cause and retry.

PATCH semantics

PATCH is a JSON merge. Omitted fields are unchanged; null clears a nullable field. Bodies are strict: an unknown field returns 400 and names the field in the error message, so typos never silently do nothing. Send at least one field. If you lower hours without sending billableHours, the existing billableHours is clamped to the new hours by the same rule the app applies; send both to control the result.

Idempotency-Key

Add an Idempotency-Key header (1–255 characters, unique per logical operation) to any POST or PATCH. Recommended for every POST.

  • Repeating the same key with the same body returns the stored 2xx response and the header Idempotent-Replayed: true. No second write happens.
  • Repeating the key with a different body returns 422 idempotency_error.
  • Repeating the key while the first request is still running returns 409 conflict with Retry-After: 1.
  • Only successful responses are stored. If a write fails, the key is released so you can fix the payload and retry with the same key.
  • Keys are scoped to your credential, the HTTP method, and the path, and expire after 24 hours.
  • If the idempotency store is unavailable and you sent a key, the request fails closed with 503 service_unavailable and Retry-After. Requests without a key are unaffected.

Limits and status codes

Bodies are capped at 64 KB (413). Writes share your credential's rate limit (see Rate limits).

Statuserror.codeMeaning
201 / 200—Created / updated; body is the same DTO GET returns, Location on 201
400invalid_requestValidation, unknown field, empty patch, bad userId
403forbiddenMissing scope, or the acting user lacks the permission
404not_foundNo such entry or client in your organization
409conflictDuplicate clientId, or an identical request is in flight
413invalid_requestBody over 64 KB
422unprocessableA business rule blocked the write
422idempotency_errorKey reused with a different body
503service_unavailableIdempotency store unavailable; retry with the same key

On this page