Gerra LogoGERRA

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}/accept

Accept a dataset that is in pending status. This approves the dataset for use in your training pipelines.

Path Parameters

ParameterTypeRequiredDescription
dataset_idstringYesDataset ID (UUID)

Headers

HeaderRequiredDescription
Gerra-Api-KeyYesYour 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

StatusDescription
401Missing or invalid Gerra-Api-Key header
403Dataset does not belong to your organization
404Dataset not found
422Dataset is not in pending status

Reject Dataset

POST/datasets/{dataset_id}/reject

Reject 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

ParameterTypeRequiredDescription
dataset_idstringYesDataset ID (UUID)

Headers

HeaderRequiredDescription
Gerra-Api-KeyYesYour API key

Request Body

FieldTypeRequiredDescription
reasonstringYesReason 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

StatusDescription
401Missing or invalid Gerra-Api-Key header
403Dataset does not belong to your organization
404Dataset not found
422Dataset 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

  1. Provide detailed rejection reasons - Help the Gerra team understand what improvements are needed
  2. Review datasets promptly - Pending datasets await your approval before they can be used
  3. Check iteration history - View previous versions to understand the refinement process
  4. Use metadata filters - Focus on specific dataset types or categories for efficient review