Skip to content

feat(API): improve delete /projects/{project_id}/screenshots/{id} documentation#1170

Open
Stephen Lumenta (sbl) wants to merge 2 commits into
mainfrom
devex-115-screenshots-delete-a-screenshot-v2
Open

feat(API): improve delete /projects/{project_id}/screenshots/{id} documentation#1170
Stephen Lumenta (sbl) wants to merge 2 commits into
mainfrom
devex-115-screenshots-delete-a-screenshot-v2

Conversation

@sbl

Copy link
Copy Markdown
Contributor

Improves the documentation for delete /projects/{project_id}/screenshots/{id}: sharper descriptions, parameter docs, error responses, and usage examples.

Drafted with AI assistance and grounded in the API implementation. Please review for technical accuracy before merging; nothing is merged automatically.

…umentation

Sharper description explains the irreversibility of deletion, cascade
side effects on screenshot markers, permission requirements (write scope,
Manage role, Attachable Screenshots plan feature), and the hex-string
shape of the id parameter. Response docs cover 204, 401, 403 (three
distinct cases), 404, 422, and 429. Code samples updated with a branch
query-parameter variant and explicit expected-response comments.

Closes DEVEX-115
@sbl Stephen Lumenta (sbl) added the developer-hub-api-quality API doc quality fix from the API Grader label Jun 10, 2026
The compare-output CI job diffs the committed bundle against a fresh
swagger-cli compile, so spec changes must ship the regenerated bundle.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment on lines +18 to +30
**Pitfalls and constraints:**
- The `id` path parameter is the screenshot's string code (a 32-character hex
string such as `d2e056aa9e70b01121f41693e344f5ee`), not a numeric database ID.
- Requires the `write` OAuth scope. Calls with only a `read` scope receive 403.
- The requesting user must have Manage permission on the Screenshot resource in
the project. Project Translators and Reviewers without Manage permission
receive 403.
- The project must have the Attachable Screenshots feature enabled on the account
plan. Accounts without this feature receive 403.
- Deletion on a protected project is blocked; the policy enforces
`!project.protected?` before granting Manage access.
- If the screenshot code does not exist in the project, the loader raises
`ActiveRecord::RecordNotFound` and the endpoint returns 404.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • all ids are 32 character hex characters. this can be removed
  • remove the code like examples

Comment on lines +32 to +36
**Error codes:** Phrase Strings uses HTTP status codes as its machine-readable
error identifiers. No additional string error codes are returned. All error
responses include a `message` field and, where applicable, a `documentation_url`
field. Validation failure responses (422) additionally include an `errors` array
with per-field `resource`, `field`, and `message` entries.

@theSoenke Sönke Behrendt (theSoenke) Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not specific to this endpoint and can be removed

Comment on lines +13 to +14
to the screenshot are removed as a cascade side effect. Translators who relied
on this screenshot for visual context will no longer see it. A `screenshots:delete`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"Translators who relied on this screenshot for visual context will no longer see it"

  • overly verbose. once deleted it's clear users cannot see it

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

Labels

developer-hub-api-quality API doc quality fix from the API Grader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants