API contracts and data schemas for the AutoGenSocial platform
Project description
AutoGenSocial Contracts
API contracts and data schemas for the AutoGenSocial platform - an AI-powered social media automation and content management system.
📋 Overview
This repository contains the contract specifications for the AutoGenSocial platform, including:
- JSON Schemas: Data models for brands, post plans, and posts
- OpenAPI Specifications: REST API definitions for all microservices
- Prompts: AI prompt templates for content generation
- Documentation: Integration guides and best practices
These contracts serve as the source of truth for all services in the AutoGenSocial ecosystem, ensuring consistent data structures and API interfaces across all components.
🏗️ Repository Structure
autogensocial-contracts/
├── schemas/ # JSON Schema definitions
│ ├── brand.json # Brand configuration schema
│ ├── postPlan.json # Content planning schema
│ └── post.json # Social media post schema
├── openapi/ # OpenAPI 3.0 specifications
│ ├── content-api.yaml # Content management API
│ ├── image-composer.yaml # Image generation API
│ └── publisher.yaml # Publishing and scheduling API
├── prompts/ # AI prompt templates
└── docs/ # Additional documentation
🎯 Purpose
The AutoGenSocial platform automates social media content creation, planning, and publishing across multiple platforms. This contracts repository:
- Defines Data Models: Standardizes how brands, content plans, and posts are structured
- Specifies APIs: Documents all service endpoints, request/response formats, and authentication
- Enables Integration: Provides clear contracts for clients and services to integrate with the platform
- Facilitates Development: Enables parallel development of frontend and backend services
- Ensures Consistency: Maintains data integrity across distributed microservices
📊 Schemas
Brand Schema (schemas/brand.json)
Defines brand configuration including:
- Brand identity and description
- Voice and tone guidelines
- Target audience demographics
- Visual identity (colors, logos, fonts)
- Connected social media accounts
- Content posting guidelines
Post Plan Schema (schemas/postPlan.json)
Defines content planning and campaigns:
- Campaign objectives and goals
- Content themes and keywords
- Publishing schedule and frequency
- Platform targeting
- Content mix distribution
- Approval workflows
Post Schema (schemas/post.json)
Defines individual social media posts:
- Post content and media
- Platform-specific metadata
- Scheduling information
- Engagement metrics
- Approval status
- AI generation metadata
🔌 APIs
Content API (openapi/content-api.yaml)
Manages brands, post plans, and content generation:
- Base URL:
https://api.autogensocial.com/v1 - Authentication: Bearer JWT tokens
- Key Endpoints:
GET/POST /brands- Brand managementGET/POST /post-plans- Content planningGET/POST /posts- Post managementPOST /content/generate- AI content generation
Image Composer API (openapi/image-composer.yaml)
Handles AI-powered image generation:
- Base URL:
https://images.autogensocial.com/v1 - Authentication: Bearer JWT tokens
- Key Endpoints:
POST /generate- Generate single imagePOST /generate/batch- Batch image generationPOST /images/{id}/variations- Generate variationsGET/POST /templates- Template managementPOST /assets- Upload custom assets
Publisher API (openapi/publisher.yaml)
Manages publishing and scheduling across platforms:
- Base URL:
https://publisher.autogensocial.com/v1 - Authentication: Bearer JWT tokens
- Key Endpoints:
POST /publish- Publish immediatelyPOST /schedule- Schedule future postsGET /schedules- List scheduled postsPOST /platforms/connect- Connect social accountsGET /analytics/posts/{id}- Retrieve post analytics
📝 Versioning Strategy
This repository follows Semantic Versioning (SemVer) principles:
Version Format: MAJOR.MINOR.PATCH
- MAJOR: Breaking changes to schemas or APIs (e.g., removing required fields, changing data types)
- MINOR: Backward-compatible additions (e.g., new optional fields, new endpoints)
- PATCH: Backward-compatible fixes (e.g., documentation updates, clarifications)
API Versioning
APIs use URL-based versioning:
- Current version:
/v1 - Future versions:
/v2,/v3, etc.
Schema Versioning
Schemas include version information in their $id field:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://autogensocial.com/schemas/brand.json",
"title": "Brand"
}
Breaking Changes
When introducing breaking changes:
- Increment the MAJOR version
- Create a new API version (e.g.,
/v2) - Maintain the previous version for at least 6 months
- Provide migration guides in the
docs/folder - Tag the release in Git with the version number
Deprecation Policy
Features marked for deprecation:
- Will be announced at least 3 months in advance
- Will include migration path documentation
- Will be supported for at least 6 months after deprecation notice
- Will be removed only in MAJOR version updates
🚀 How to Use These Contracts
For API Consumers (Frontend/Client Applications)
- Review OpenAPI Specs: Browse the OpenAPI specifications in the
openapi/directory - Generate Client SDKs: Use tools like OpenAPI Generator to create client libraries
# Example: Generate TypeScript client for Content API openapi-generator-cli generate \ -i openapi/content-api.yaml \ -g typescript-axios \ -o ./generated/content-api-client
- Validate Requests: Use the schemas to validate your API requests before sending
- Handle Responses: Parse responses according to the defined schemas
For API Providers (Backend Services)
- Implement Endpoints: Build services that conform to the OpenAPI specifications
- Validate Data: Use JSON schemas to validate incoming data
// Example: Validate brand data in Node.js const Ajv = require('ajv'); const ajv = new Ajv(); const schema = require('./schemas/brand.json'); const validate = ajv.compile(schema); const valid = validate(brandData);
- Generate Server Stubs: Use OpenAPI tools to generate server boilerplate
- Auto-generate Documentation: Tools like Swagger UI can render interactive API docs
For Testing
- Schema Validation: Validate test data against JSON schemas
- Contract Testing: Ensure API responses match OpenAPI specifications
- Mock Servers: Generate mock servers from OpenAPI specs for testing
# Example: Run a mock server with Prism prism mock openapi/content-api.yaml
For Documentation
- Interactive Docs: Use Swagger UI or ReDoc to render interactive documentation
# Serve with Swagger UI npx @redocly/openapi-cli preview-docs openapi/content-api.yaml
- API Reference: Include OpenAPI specs in developer documentation
- Code Examples: Generate code examples in multiple languages from specs
🛠️ Development Workflow
Making Changes
-
Clone the repository
git clone https://github.com/1084-Ventures/autogensocial-contracts.git cd autogensocial-contracts
-
Create a feature branch
git checkout -b feature/add-new-field
-
Make changes to schemas or OpenAPI specs
- Edit JSON schema files in
schemas/ - Update OpenAPI YAML files in
openapi/
- Edit JSON schema files in
-
Validate your changes
# Validate JSON schemas ajv validate -s schemas/brand.json -d examples/brand-example.json # Validate OpenAPI specs npx @redocly/openapi-cli lint openapi/content-api.yaml
-
Update version numbers (if needed)
- Update API version in OpenAPI
info.version - Tag release after merging
- Update API version in OpenAPI
-
Submit a pull request
Validation Tools
Recommended tools for validating contracts:
- JSON Schema: AJV - Fast JSON validator
- OpenAPI: @redocly/openapi-cli - OpenAPI linter and validator
- API Testing: Prism - Mock server and validator
🔐 Security
- All APIs use Bearer token authentication (JWT)
- Sensitive data should never be committed to this repository
- API keys and credentials must be managed through environment variables
- Follow OAuth 2.0 for platform integrations (Twitter, Facebook, etc.)
🤝 Contributing
Contributions are welcome! Please follow these guidelines:
- Follow existing schema and API design patterns
- Maintain backward compatibility when possible
- Document all changes in pull request descriptions
- Validate all changes before submitting
- Add examples for new fields or endpoints
📄 License
See LICENSE file for details.
📞 Support
For questions or issues:
- Email: support@autogensocial.com
- Issues: GitHub Issues
🗺️ Roadmap
Future additions to this repository:
- AsyncAPI specifications for event-driven communication
- GraphQL schema definitions
- Additional platform integrations (Pinterest, Snapchat)
- Webhook event schemas
- Example request/response payloads
- Integration test suites
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters