Initialize
The initialize endpoint allows you to create new Waldium sites programmatically with a single API call. It combines website analysis, content generation, and site setup into one streamlined process.
Initialize a site
This endpoint creates a new Waldium site with optional website analysis, content generation, and branding setup.
Required attributes
- Name
Authorization
- Type
- string
- Description
Bearer token with your API key for authentication.
Optional attributes
- Name
websiteUrl
- Type
- string
- Description
URL of the website to analyze for branding and content insights.
- Name
logo
- Type
- string
- Description
Base64-encoded image data for the site logo.
- Name
options
- Type
- object
- Description
Additional configuration options for site creation.
Options object
- Name
generatePosts
- Type
- boolean
- Description
Whether to generate initial blog posts. Defaults to true.
- Name
postCount
- Type
- number
- Description
Number of posts to generate. Defaults to 5.
- Name
description
- Type
- string
- Description
Custom description for the site.
- Name
prompt
- Type
- string
- Description
Custom prompt for AI content generation.
Request
curl -X POST https://api.blogwald.com/api/v1/initialize \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"websiteUrl": "https://example.com",
"logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"options": {
"generatePosts": true,
"postCount": 5,
"description": "Custom site description",
"prompt": "Create engaging content about technology trends"
}
}'
Success Response
{
"success": true,
"site": {
"id": "site_123",
"name": "Example Blog",
"url": "https://example.waldium.app",
"adminUrl": "https://app.waldium.com/sites/site_123"
},
"author": {
"id": "author_456",
"name": "API User"
},
"postsGenerated": 5,
"websiteAnalysis": {
"description": "AI-generated description based on website analysis",
"prompt": "AI-generated prompt for content creation",
"brandColor": "#000000"
}
}
Error Response - Site Exists
{
"success": false,
"error": "Organization already has a site",
"code": "SITE_EXISTS",
"existingSite": {
"id": "site_123",
"name": "Existing Blog",
"url": "https://existing.waldium.app"
}
}
Error Response - Analysis Failed
{
"success": false,
"error": "Failed to analyze website",
"code": "ANALYSIS_FAILED",
"details": "Website is blocking automated requests"
}
Error Handling
Common Error Codes
- Name
SITE_EXISTS
- Type
- string
- Description
Your organization already has a site.
- Name
ANALYSIS_FAILED
- Type
- string
- Description
Website analysis failed. Site creation continues with default settings.
- Name
INVALID_LOGO
- Type
- string
- Description
The provided logo data is invalid or unsupported format.
- Name
RATE_LIMIT_EXCEEDED
- Type
- string
- Description
Too many initialize requests. Wait before making another request.
Rate Limiting
The initialize endpoint has special rate limits:
- 10 requests per hour per API key
- Rate limit headers are included in responses