API Documentation

Complete reference for integrating BabyZilla2's enterprise data processing platform into your applications.

Getting Started

Welcome to the BabyZilla2 API! Our RESTful API allows you to integrate powerful document processing, AI agent orchestration, and blockchain features into your applications.

🚀 Quick Start

Get up and running with the BabyZilla2 API in minutes:

  1. Sign up for a free account at babyzilla2.com
  2. Generate your API key from the dashboard
  3. Make your first API call

Base URL

https://api.babyzilla2.com/v1

Quick Example

curl -X POST https://api.babyzilla2.com/v1/documents/process \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "csv_cleaning", "data": { "file_url": "https://example.com/data.csv", "transformations": ["trim_whitespace", "remove_duplicates"] } }'

Authentication

BabyZilla2 uses API keys for authentication. Include your API key in the Authorization header of every request.

API Key Authentication

Authorization: Bearer YOUR_API_KEY

Enterprise SSO

Enterprise customers can use Single Sign-On (SSO) with SAML 2.0 or OAuth 2.0. Contact support for configuration.

Header Value Description
Authorization Bearer {token} Your API key from the dashboard
X-Tenant-ID string Required for multi-tenant enterprise accounts

Document Processing

Process documents with intelligent AI transformations, OCR capabilities, and custom rule sequences.

POSTProcess Document Requires Auth

/api/v1/documents/process

Submit a document for processing with custom transformations and AI analysis.

Request Parameters

Parameter Type Required Description
type string Required Processing type: csv_cleaning, pdf_extraction, nlp_analysis
data object Required Processing-specific data payload
priority string Optional Processing priority: high, medium, low (default: medium)
webhook_url string Optional URL to receive processing completion webhook

Example Request

{ "type": "csv_cleaning", "priority": "high", "data": { "file_url": "https://example.com/data.csv", "transformations": [ "trim_whitespace", "remove_duplicates", "normalize_emails", "normalize_phone_numbers" ], "options": { "has_headers": true, "delimiter": ",", "encoding": "utf-8" } }, "webhook_url": "https://yourapp.com/webhooks/babyzilla" }
Response (202 Accepted)
{ "job_id": "job_1234567890_abc123", "status": "queued", "estimated_completion": "2024-01-15T10:30:00Z", "queue_position": 3, "stream_url": "https://api.babyzilla2.com/v1/jobs/job_1234567890_abc123/stream" }

GETJob Status

/api/v1/jobs/{job_id}/status

Get real-time processing status and progress updates.

Response (200 OK)
{ "job_id": "job_1234567890_abc123", "status": "processing", "progress": 75, "stage": "applying_transformations", "processed_rows": 7500, "total_rows": 10000, "estimated_time_remaining": "2 minutes", "tokens_earned": 45 }

Enterprise Processing API

Ultra-low latency processing with advanced queue management and real-time streaming capabilities.

POSTSubmit Enterprise Job Enterprise Only

/api/v1/enterprise/processing/submit

Submit high-priority processing jobs to the enterprise queue with sub-second response times.

Request Parameters

Parameter Type Required Description
type string Required Job type: document_processing, data_transformation, export_generation
priority string Optional Priority level: critical, high, medium, low
data object Required Job-specific data payload
metadata object Optional Additional metadata including expected duration and dependencies

GETReal-Time Stream

/api/v1/enterprise/processing/{job_id}/stream

Establish Server-Sent Events stream for real-time job updates with ultra-low latency.

# Example SSE Stream Response data: {"type":"progress","job_id":"job_123","progress":25,"stage":"chunking"} data: {"type":"progress","job_id":"job_123","progress":50,"stage":"processing"} data: {"type":"complete","job_id":"job_123","result_url":"https://api.babyzilla2.com/v1/results/job_123"}

POSTBatch Processing

/api/v1/enterprise/processing/batch

Submit multiple processing jobs with dependency management and optimized scheduling.

AI Agent Orchestration

Deploy conversational AI agents that understand your data and create custom processing workflows.

POSTCreate Conversation

/api/v1/agents/conversations

Start a new conversation with an AI agent for interactive data processing.

Example Request

{ "document_id": "doc_12345", "initial_message": "Help me clean this customer data and remove duplicates", "context": { "data_preview": true, "available_columns": ["name", "email", "phone", "address"] } }

POSTSend Message

/api/v1/agents/conversations/{conversation_id}/messages

Send a message to an AI agent and receive intelligent responses with suggested actions.

Response
{ "response": "I'll help you clean that data! I can see duplicate emails and inconsistent phone formats. Let me create a cleaning sequence for you.", "suggested_rules": [ { "type": "data_cleaning", "operation": "remove_duplicates", "parameters": {"key_columns": ["email"]} }, { "type": "data_transformation", "operation": "normalize_phone_numbers", "parameters": {"format": "international"} } ], "actions": [ { "type": "execute_sequence", "description": "Clean customer data", "estimated_duration": "30 seconds" } ] }

Blockchain Integration

Manage ZILLA tokens, staking, and blockchain rewards through our Solana-based integration.

GETToken Balance

/api/v1/tokens/balance

Get current ZILLA token balance and earning history.

Response
{ "balance": { "zilla_tokens": 1250.5, "sol_balance": 0.025, "staked_tokens": 500.0 }, "recent_earnings": [ { "amount": 25.5, "reason": "Document processing reward", "timestamp": "2024-01-15T09:30:00Z", "transaction_id": "tx_abc123" } ] }

POSTStake Tokens

/api/v1/blockchain/stake

Stake ZILLA tokens to earn rewards and access premium features.

GETTransaction History

/api/v1/blockchain/transactions

Get detailed transaction history with blockchain verification.

Webhooks

Receive real-time notifications when processing jobs complete, errors occur, or tokens are earned.

Webhook Events

Event Type Description Data Included
job.completed Processing job finished successfully job_id, result_url, tokens_earned, processing_time
job.failed Processing job encountered an error job_id, error_code, error_message, retry_count
tokens.earned ZILLA tokens earned from activity amount, reason, transaction_id, balance
agent.response AI agent generated a response conversation_id, message, suggested_actions

Webhook Payload Example

{ "event": "job.completed", "timestamp": "2024-01-15T10:30:00Z", "data": { "job_id": "job_1234567890_abc123", "status": "completed", "result_url": "https://api.babyzilla2.com/v1/results/job_1234567890_abc123", "tokens_earned": 45, "processing_time": 120.5, "original_rows": 10000, "processed_rows": 9847, "transformations_applied": [ "trim_whitespace", "remove_duplicates", "normalize_emails" ] } }

SDKs & Libraries

Official SDKs and community libraries to integrate BabyZilla2 into your favorite programming language.

JavaScript/Node.js

Official SDK for JavaScript and Node.js applications

npm install @babyzilla2/sdk
Python

Python SDK with async support and data science integrations

pip install babyzilla2
Java

Enterprise Java SDK with Spring Boot integration

Maven/Gradle
Go

High-performance Go library for concurrent processing

go get github.com/babyzilla2/go-sdk
C#/.NET

.NET library with async/await patterns

NuGet Package
Ruby

Ruby gem for Rails and Sinatra applications

gem install babyzilla2

JavaScript SDK Example

import BabyZilla2 from '@babyzilla2/sdk'; const client = new BabyZilla2({ apiKey: 'your-api-key', baseUrl: 'https://api.babyzilla2.com/v1' }); // Process a document const job = await client.documents.process({ type: 'csv_cleaning', data: { file_url: 'https://example.com/data.csv', transformations: ['trim_whitespace', 'remove_duplicates'] } }); // Listen for real-time updates client.jobs.stream(job.job_id, (update) => { console.log(`Progress: ${update.progress}%`); if (update.status === 'completed') { console.log(`Result: ${update.result_url}`); } });

Rate Limits

API rate limits vary by plan tier to ensure fair usage and optimal performance.

Plan Requests/Minute Documents/Month Concurrent Jobs
Starter 60 10,000 5
Professional 300 50,000 20
Enterprise Unlimited Unlimited Unlimited

Rate Limit Headers

X-RateLimit-Limit: 300 X-RateLimit-Remaining: 299 X-RateLimit-Reset: 1642248000

Error Handling

BabyZilla2 uses conventional HTTP response codes and detailed error messages.

HTTP Status Codes

Code Meaning Description
200 OK Request succeeded
202 Accepted Request accepted for processing
400 Bad Request Invalid request parameters
401 Unauthorized Invalid or missing API key
403 Forbidden Insufficient permissions
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server-side error occurred

Error Response Format

{ "error": { "code": "INVALID_DOCUMENT_FORMAT", "message": "The provided document format is not supported", "details": { "supported_formats": ["csv", "xlsx", "pdf", "json", "xml"], "received_format": "doc" }, "request_id": "req_1234567890" } }