crowdin / crowdin/crowdin-api-client-ruby

Add support for asynchronous Branch, Directory and File deletion

Open
#127 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
59
Forks
22
Avg merge
1h 11m
Merged PRs (30d)
1

Description

The Crowdin API now supports asynchronous deletion of branches, directories, and files. The existing Delete endpoints accept an optional `Prefer: respond-async` request header (RFC 7240). When it is provided, the API responds with `202 Accepted` and a delete job resource instead of `204 No Content`, and new endpoints allow polling the job status.

New **Check Delete Job Status** endpoints:

- **Check Branch Deletion Status** — `GET /projects/{projectId}/branches/{branchId}/jobs/{jobIdentifier}` (`api.projects.branches.jobs.get`) — file-based and string-based projects
- **Check Directory Deletion Status** — `GET /projects/{projectId}/directories/{directoryId}/jobs/{jobIdentifier}` (`api.projects.directories.jobs.get`) — file-based projects only
- **Check File Deletion Status** — `GET /projects/{projectId}/files/{fileId}/jobs/{jobIdentifier}` (`api.projects.files.jobs.get`) — file-based projects only

Updated endpoints (new optional `Prefer` header + `202` response): **Delete Branch** (`api.projects.branches.delete`), **Delete Directory** (`api.projects.directories.delete`), **Delete File** (`api.projects.files.delete`).

The job resource model includes: `identifier` (UUID string), `status` (`created`, `in_progress`, `finished`, `failed`), `progress` (integer, percent), `attributes` (contains `branchId`, `directoryId`, or `fileId`), `error` (object with `message`, present only when the operation failed), and `createdAt`/`updatedAt`/`startedAt`/`finishedAt` timestamps.

Client libraries should support the async deletion flow and the new job status methods. Available in both Crowdin and Crowdin Enterprise.

**References:**
- [Delete Branch](https://support.crowdin.com/developer/api/v2/#operation/api.projects.branches.delete)
- [Check Branch Deletion Status](https://support.crowdin.com/developer/api/v2/#operation/api.projects.branches.jobs.get)
- [Delete Directory](https://support.crowdin.com/developer/api/v2/#operation/api.projects.directories.delete)
- [Check Directory Deletion Status](https://support.crowdin.com/developer/api/v2/#operation/api.projects.directories.jobs.get)
- [Delete File](https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.delete)
- [Check File Deletion Status](https://support.crowdin.com/developer/api/v2/#operation/api.projects.files.jobs.get)
- Crowdin Enterprise: [Delete Branch](https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.branches.delete), [Check Branch Deletion Status](https://support.crowdin.com/developer/enterprise/api/v2/#operation/api.projects.branches.jobs.get)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.