> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/hi/apis/releases-api.md).

# Releases API

Unitlab Releases API: HTTP से रिलीज़ बनाएँ, COCO, YOLO या UUEF फ़ॉर्मैट चुनें, तैयारी की प्रगति देखें और एनोटेशन स्प्लिट व सोर्स फ़ाइलें डाउनलोड करें।

सभी रूट के लिए **Manage releases** चाहिए।

| Method और रूट                           | काम                                 |
| --------------------------------------- | ----------------------------------- |
| `POST /api/sdk/projects/{id}/releases/` | रिलीज़ शुरू करें                    |
| `GET /api/sdk/releases/`                | तैयार रिलीज़ की सूची (सादा array)   |
| `GET /api/sdk/releases/{id}/`           | एक रिलीज़ पढ़ें, तैयारी के दौरान भी |
| `GET /api/sdk/releases/{id}/status/`    | तैयारी की प्रगति                    |
| `POST /api/sdk/releases/{id}/`          | डाउनलोड लिंक पाएँ                   |

## बनाना <a href="#create" id="create"></a>

```bash
curl -s -X POST "https://api.unitlab.ai/api/sdk/projects/$PROJECT_ID/releases/" \
  -H "Authorization: Api-Key $UNITLAB_API_KEY" -H "Content-Type: application/json" \
  -d '{"export_type": "COCO", "split_ratios": {"train": 80, "test": 20}, "completed_only": true}'
```

| फ़ील्ड                    | उपयोग                                                                                  |
| ------------------------- | -------------------------------------------------------------------------------------- |
| `export_type`             | `COCO`, `YOLOv8`, `YOLOv5`, `Audio JSON`, `RTTM`, `JSONL`, `GeoJSON` या `UUEF`         |
| `split_ratios`            | `train`, `validation` और `test` के प्रतिशत। डिफ़ॉल्ट `{"train": 100}`।                 |
| `completed_only`          | सिर्फ़ Complete स्टेज वाले आइटम                                                        |
| `upload_sessions`         | सिर्फ़ ये Batch Queue ID                                                               |
| `generic_types`           | सिर्फ़ ये टाइप, जैसे `["img", "video"]`                                                |
| `bundle_formats`          | मिश्रित प्रोजेक्ट के लिए हर टाइप का फ़ॉर्मैट: `{"img": "COCO", "audio": "Audio JSON"}` |
| `include_download_tokens` | हर आइटम के लिए स्थायी डाउनलोड लिंक जोड़ें                                              |
| `license`                 | डेटासेट लाइसेंस ID; सक्रिय सब्सक्रिप्शन के बिना ज़रूरी                                 |

जवाब `status` `pending` वाली रिलीज़ है। अगर उसी प्रोजेक्ट की एक रिलीज़ तैयार हो रही हो, तो दूसरी रिलीज़ 409 और code `release_in_progress` लौटाती है।

## तैयारी ट्रैक करें <a href="#follow-preparation" id="follow-preparation"></a>

```bash
curl -s "https://api.unitlab.ai/api/sdk/releases/$RELEASE_ID/status/" -H "Authorization: Api-Key $UNITLAB_API_KEY"
```

```json
{"status": "completed", "total": 100, "completed": 100, "processing": 0, "failed": 0, "release_status": "ready", "status_error": ""}
```

`release_status` `pending` से `exporting` और फिर `ready` या `failed` तक जाता है। `completed` प्रतिशत में प्रगति है।

## डाउनलोड <a href="#download" id="download"></a>

```bash
URL=$(curl -s -X POST "https://api.unitlab.ai/api/sdk/releases/$RELEASE_ID/" \
  -H "Authorization: Api-Key $UNITLAB_API_KEY" -H "Content-Type: application/json" \
  -d '{"download_type": "annotation", "split_type": "train"}' | jq -r .file)
curl -s -o train.json "$URL"
```

| बॉडी                                                     | जवाब                                                                                             |
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `{"download_type": "annotation", "split_type": "train"}` | एक स्प्लिट के लिए `{"file": "<signed link>"}`। पूरी संयुक्त रिलीज़ के लिए `split_type` छोड़ दें। |
| `{"download_type": "files"}`                             | `{"file_name", "source"}` मीडिया लिंक की सूची, या टेक्स्ट आइटम के लिए `{"file_name", "content"}` |

साइन किए गए लिंक `Authorization` हेडर के बिना लाएँ। रिलीज़ तैयार होने से पहले डाउनलोड करने पर 409 और code `release_not_ready` मिलता है; खाली स्प्लिट 400 लौटाता है।

## रिलीज़ फ़ील्ड <a href="#release-fields" id="release-fields"></a>

`pk`, `name`, `version`, `generic_type`, `number_of_data`, `is_public`, `status`, `progress`, `status_error`, `completed_only`।

## संबंधित <a href="#related" id="related"></a>

[SDK: रिलीज़ बनाएँ और डाउनलोड करें](https://docs.unitlab.ai/api-sdk-cli/hi/sdks/create-and-download-releases.md) · [एक्सपोर्ट फ़ॉर्मैट](https://docs.unitlab.ai/documentation/hi/releases/export-formats-and-source-inclusion)
