Skip to content

docs(tasks): document account_id on DELETE /api/tasks - #283

Open
sweetmantech wants to merge 1 commit into
mainfrom
docs/delete-task-account-id
Open

docs(tasks): document account_id on DELETE /api/tasks#283
sweetmantech wants to merge 1 commit into
mainfrom
docs/delete-task-account-id

Conversation

@sweetmantech

@sweetmantech sweetmantech commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Contract for the DELETE /api/tasks admin-override row of chat#1918. Docs lead; the api PR follows and implements exactly this.

What changes

Adds an optional account_id to DeleteTaskRequest, mirroring the wording already used on UpdateTaskRequest:

"account_id": {
  "type": "string",
  "format": "uuid",
  "description": "UUID of the account to delete the task for. Only applicable when the authenticated account has access to multiple accounts via organization membership. If not provided, the task is deleted for the API key's own account.",
  "example": "848cd58d-700f-4b38-ab4c-d9f52a1b2c3d"
}

required stays ["id"] — the parameter is optional and existing callers are unaffected.

Why

DELETE is the only task verb whose request schema lacks it. GET, POST and PATCH all accept the org/admin account context, so an admin key can create, read and edit a customer's task but gets 403 deleting it. Hit live on 2026-07-29 and again 2026-07-30; the workaround is PATCH {enabled:false}, whose re-sync also removes the Trigger schedule.

The 403 response is already documented on this operation, so no response codes change — this only makes the successful admin path expressible.

Edit method

releases.json does not round-trip byte-identically through json.load/json.dumps (verified), so this was applied as an anchored text edit at the property boundary rather than load→dump. Result re-validated: the file parses, and DeleteTaskRequest.properties is now ['id', 'account_id']. Diff is 6 insertions, 0 deletions.

Merge order

This PR first, then the api implementation. Linked from the #1918 matrix.

🤖 Generated with Claude Code


Summary by cubic

Added an optional account_id to DeleteTaskRequest for DELETE /api/tasks, enabling org/admin keys to delete a task in a specified account. This aligns DELETE with GET/POST/PATCH; id remains required and existing callers are unaffected.

Written for commit ad35bb2. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Task deletion requests can now optionally specify an account context using a valid account ID.
    • Added documentation and an example for the new account selection behavior.
    • Requests without an account ID continue using the default context.

DELETE is the only task verb whose request schema lacks account_id — GET,
POST and PATCH all accept the org/admin account context. This is the contract
half of chat#1918; api follows.

chat#1918
@cursor

cursor Bot commented Jul 31, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1a856c62-249c-414a-88f7-5f269683b156

📥 Commits

Reviewing files that changed from the base of the PR and between d673296 and ad35bb2.

📒 Files selected for processing (1)
  • api-reference/openapi/releases.json

📝 Walkthrough

Walkthrough

The OpenAPI DeleteTaskRequest schema now accepts an optional UUID account_id, documenting account override behavior and fallback to the API key’s default account.

Changes

Delete task request

Layer / File(s) Summary
DeleteTaskRequest account selector
api-reference/openapi/releases.json
Adds optional account_id UUID validation and documents accessible-account selection with default-account fallback.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes documenting the optional account_id field for DELETE /api/tasks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/delete-task-account-id

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant