Skip to content

docs: Add ADR 0045 - API standards for acting upon resources - #886

Closed
mike-gorman-bitwarden wants to merge 1 commit into
mainfrom
docs/adr-0045-api-standards-for-acting-upon-resources
Closed

mike-gorman-bitwarden wants to merge 1 commit into
mainfrom
docs/adr-0045-api-standards-for-acting-upon-resources

Conversation

@mike-gorman-bitwarden

@mike-gorman-bitwarden mike-gorman-bitwarden commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🎟️ Tracking

Follow-up to ADR-0036 (#865).

📔 Objective

Adds ADR-0045, "API standards for acting upon resources", with status Proposed. Sets how operations outside create, read, update, and delete are exposed, as actions at /{resource plural}/{id}/actions/{action}, and that asynchronous work returns 202 with a job. Defining the job resource is left to a later ADR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying contributing-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3360db0
Status: ✅  Deploy successful!
Preview URL: https://02c9c24f.contributing-docs.pages.dev
Branch Preview URL: https://docs-adr-0045-api-standards.contributing-docs.pages.dev

View logs

@rkac-bw

rkac-bw commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

From the database side:

  1. Actions are POSTs, so they have the same retry problem as creates. A retried send-email or rotate-key runs twice. The idempotency mechanism suggested on ADR-0042 should cover actions as well.
  2. For the follow-up job ADR: please include where job records are stored, how long they are retained, and how callers poll (with Retry-After on 202 and on job reads). Jobs will be the home of long-running work such as backfills and bulk changes, so their storage and polling cost matter.

@mike-gorman-bitwarden

Copy link
Copy Markdown
Contributor Author
  1. Same answer as on ADR-0042: no new header. Many actions are naturally idempotent (disabling a disabled user does nothing). For those that aren't, the body shape is open, so an action can take a caller-chosen ID and ignore a repeat. Whether it needs to is up to each API.
  2. How a caller follows a job's progress, including polling and Retry-After, is already planned for the job ADR. Where a service stores its jobs and how long it keeps them is up to that service.

@mike-gorman-bitwarden
mike-gorman-bitwarden marked this pull request as ready for review October 14, 2026 09:10
@mike-gorman-bitwarden
mike-gorman-bitwarden requested a review from a team as a code owner October 14, 2026 09:10
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR adds ADR-0045 (status Proposed), which defines how operations outside create, read, update, and delete are exposed as POST /api/v1/{resource plural}/{id}/actions/{action}, and requires asynchronous work to return 202 Accepted with a job. The frontmatter, AdrTable usage, RFC 2119 notation section, and MADR structure match ADR-0036 and the ADR index template. ADR-0039 and ADR-0046 are mentioned as plain text rather than links, which fits ADRs that are not yet on main. No issues found.

@mike-gorman-bitwarden

Copy link
Copy Markdown
Contributor Author

This PR is superseded by #894. We have done our best to retain/incorporate all feedback received to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants