Skip to content

docs(API): improve DELETE /projects/:id/documents/:id documentation#1177

Open
Stephen Lumenta (sbl) wants to merge 1 commit into
mainfrom
devex-119-documents-delete-document
Open

docs(API): improve DELETE /projects/:id/documents/:id documentation#1177
Stephen Lumenta (sbl) wants to merge 1 commit into
mainfrom
devex-119-documents-delete-document

Conversation

@sbl

@sbl Stephen Lumenta (sbl) commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Improves the documentation for DELETE /projects/:project_id/documents/:id (delete document).

Changes

  • Adds conceptual description: what the operation does, why/when to use it (cleanup), the permanent-deletion model, and pitfalls
  • Documents 401 and improves 403 response with causes and remediation (scope + manage permission requirement)
  • Adds 422 response for model-level constraint failures
  • Improves curl example to show expected HTTP 200 response

All changes are spec-layer only (paths/documents/destroy.yaml + compiled bundle). No Ruby source edits.

Part of DEVEX-119.

Drafted with AI assistance and grounded in the strings-app source. Please review for technical accuracy before merging; nothing is merged automatically.

🤖 Generated with Claude Code

Adds conceptual description (why/model including permanent deletion warning),
documents 401/403 responses with causes and remediation, adds 422 response
for model-level constraint failures, and improves example to show expected
200 response.

Part of DEVEX-119.

🤖 Generated with Claude Code (claude-sonnet-4-6)
@sbl Stephen Lumenta (sbl) added the developer-hub-api-quality API doc quality fix from the API Grader label Jun 10, 2026

Use this endpoint to clean up source documents that are no longer needed — for example, after a campaign has ended or a deprecated content file has been superseded. The deletion is irreversible; ensure you have exported or archived any segment translations before proceeding.

The document is identified by its `id` (the document's code, not a numeric primary key). The token must have the `write` scope. Deletion is subject to the document policy (`DocumentPolicy#destroy?`), which requires manage permissions on the document.

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.

"numeric primary key" is an internal development detail and should not be exposed.

'403':
"$ref": "../../responses.yaml#/403"
description: Forbidden. Returned when the access token lacks the `write` scope or when the requesting user is not allowed to delete this document.
description: |

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.

this description is almost fully generic and could be moved to the referenced section.

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