Accept & Reject Datasets
Review and approve or reject pending datasets
Accept & Reject Datasets
Review datasets and update their status. Only datasets with pending status can be accepted or rejected.
Accept Dataset
POST
/datasets/{dataset_id}/acceptAccept a dataset that is in pending status. This approves the dataset for use in your training pipelines.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dataset_id | string | Yes | Dataset ID (UUID) |
Headers
| Header | Required | Description |
|---|---|---|
Gerra-Api-Key | Yes | Your API key |
Example Request
curl -X POST "https://api.gerra.com/datasets/770e8400-e29b-41d4-a716-446655440000/accept" \
-H "Gerra-Api-Key: gerra_1234567890abcdef"Response
{
"id": "770e8400-e29b-41d4-a716-446655440000",
"status": "accepted",
"message": "Dataset accepted successfully"
}Error Responses
| Status | Description |
|---|---|
401 | Missing or invalid Gerra-Api-Key header |
403 | Dataset does not belong to your organization |
404 | Dataset not found |
422 | Dataset is not in pending status |
Reject Dataset
POST
/datasets/{dataset_id}/rejectReject a dataset that is in pending status with a reason. The rejection reason will be stored in the dataset's metadata for future reference.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dataset_id | string | Yes | Dataset ID (UUID) |
Headers
| Header | Required | Description |
|---|---|---|
Gerra-Api-Key | Yes | Your API key |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
reason | string | Yes | Reason for rejection |
Example Request
curl -X POST "https://api.gerra.com/datasets/770e8400-e29b-41d4-a716-446655440000/reject" \
-H "Gerra-Api-Key: gerra_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"reason": "Data quality issues: missing required fields in 45% of records"
}'Response
{
"id": "770e8400-e29b-41d4-a716-446655440000",
"status": "rejected",
"message": "Dataset rejected successfully"
}Error Responses
| Status | Description |
|---|---|
401 | Missing or invalid Gerra-Api-Key header |
403 | Dataset does not belong to your organization |
404 | Dataset not found |
422 | Dataset is not in pending status or missing reason |
Review Workflow
Here's a typical workflow for reviewing datasets:
import requests
API_KEY = "gerra_1234567890abcdef"
HEADERS = {"Gerra-Api-Key": API_KEY}
# 1. Get all pending datasets
response = requests.get(
"https://api.gerra.com/datasets",
params={"status": "pending"},
headers=HEADERS
)
pending = response.json()["datasets"]
for dataset in pending:
# 2. Get full details with download URL
details = requests.get(
"https://api.gerra.com/datasets/dataset",
params={"id": dataset["id"]},
headers=HEADERS
).json()
# 3. Download and review the dataset
# ... your review logic here ...
# 4. Accept or reject based on review
if passes_quality_check(details):
requests.post(
f"https://api.gerra.com/datasets/{dataset['id']}/accept",
headers=HEADERS
)
print(f"Accepted: {dataset['name']}")
else:
requests.post(
f"https://api.gerra.com/datasets/{dataset['id']}/reject",
headers=HEADERS,
json={"reason": "Failed quality check: [specific reason]"}
)
print(f"Rejected: {dataset['name']}")Best Practices
- Provide detailed rejection reasons - Help the Gerra team understand what improvements are needed
- Review datasets promptly - Pending datasets await your approval before they can be used
- Check iteration history - View previous versions to understand the refinement process
- Use metadata filters - Focus on specific dataset types or categories for efficient review