API Documentation
Build powerful integrations with the Irresistible API.
Overview
Base URL
https://api.irresistible.app
Authentication
All API requests must include an authorization header with a valid access token.
Authorization: Bearer YOUR_TOKEN
Rate Limits
API requests are rate limited based on your plan:
- Free: 100 requests/hour
- Pro: 1,000 requests/hour
- Team: 10,000 requests/hour
Code Examples
Authentication
// Authentication example
const response = await fetch('https://api.irresistible.app/api/auth/token', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
apiKey: 'your-api-key',
apiSecret: 'your-api-secret'
})
});
const { token } = await response.json();
Create Project
// Create a new project
const response = await fetch('https://api.irresistible.app/api/projects', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + token,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'My Awesome Project',
template: 'react',
description: 'A new React project'
})
});
const project = await response.json();
AI Code Generation
// Generate code with AI
const response = await fetch('https://api.irresistible.app/api/ai/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + token,
'Content-Type': 'application/json',
},
body: JSON.stringify({
prompt: 'Create a React component for a user profile card',
language: 'typescript',
framework: 'react'
})
});
const { code, explanation } = await response.json();
API Endpoints
Authentication
All API requests require authentication using an API key.
POST
Generate an access token/api/auth/token
POST
Refresh an expired token/api/auth/refresh
POST
Revoke an access token/api/auth/revoke
Projects
Manage your projects programmatically.
GET
List all projects/api/projects
POST
Create a new project/api/projects
GET
Get project details/api/projects/:id
PUT
Update project/api/projects/:id
DELETE
Delete project/api/projects/:id
AI Assistant
Interact with the AI assistant programmatically.
POST
Send a message to AI assistant/api/ai/chat
POST
Generate code from prompt/api/ai/generate
GET
Get AI usage statistics/api/ai/usage
Deployments
Deploy and manage your applications.
POST
Deploy a project/api/deploy
GET
Get deployment status/api/deployments/:id
GET
Get deployment logs/api/deployments/:id/logs
Response Format
All API responses follow a consistent JSON format:
Success Response
{
"success": true,
"data": {
// Response data
},
"meta": {
"timestamp": "2024-01-01T00:00:00Z",
"version": "1.0"
}
}
Error Response
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid API key",
"details": {
// Additional error info
}
}
}
Error Codes
Code | Description | HTTP Status |
---|---|---|
INVALID_REQUEST | Invalid request parameters | 400 |
UNAUTHORIZED | Missing or invalid authentication | 401 |
FORBIDDEN | Insufficient permissions | 403 |
NOT_FOUND | Resource not found | 404 |
RATE_LIMITED | Too many requests | 429 |
SERVER_ERROR | Internal server error | 500 |
SDKs & Libraries
Official SDKs for popular languages and frameworks:
Need Help with the API?
Check out our detailed API guides or reach out to our developer support team.