crowdin / crowdin/crowdin-api-client-go

Add support for asynchronous Branch, Directory and File deletion

Open
#149 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10
Forks
18
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

Research direction

Start by reading the existing api.projects.branches.delete, api.projects.directories.delete, and api.projects.files.delete methods and their response models. Compare them with the linked Crowdin API references, then trace how related job resources are represented. Done means the three deletes support Prefer: respond-async and each resource has a job-status method covering the documented responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.