API Reference

Predict with our
REST API

Complete API documentation for the aplil prediction.

QUICK START

Base URL

https://api.aplil.com/v1

Authentication

All API requests require authentication using a Bearer token in the Authorization header.

Authorization: Bearer aplil_sk_xxxxxxxxxxxxx

Response Format

All responses are returned in JSON format with appropriate HTTP status codes.

200Success
201Created
400Bad Request
401Unauthorized
429Rate Limited

Example Request

# List all projects
curl https://api.aplil.com/v1/projects \
  -H "Authorization: Bearer aplil_sk_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json"

Example Response

{
  "data": [
    {
      "id": "prj_xxxxxxxxxxxxx",
      "name": "my-app",
      "created_at": "2025-01-15T10:30:00Z",
      "status": "active"
    }
  ],
  "pagination": {
    "total": 42,
    "page": 1,
    "limit": 20
  }
}

API Endpoints

Complete reference for all available API endpoints organized by resource type.

PROJECTS

GET/projects

List all projects in your account

Query params: ?page=1&limit=20&sort=created_at
POST/projects

Create a new project

Request body:{ "name": "string", "description": "string", "framework": "string" }
GET/projects/:id

Get detailed information about a specific project

PATCH/projects/:id

Update project settings and configuration

Request body:{ "name": "string", "description": "string", "settings": "object" }
DELETE/projects/:id

Permanently delete a project and all its data

DEPLOYMENTS

GET/deployments

List all deployments across your projects

Query params: ?project_id=xxx&status=success&limit=50
POST/deployments

Trigger a new deployment

Request body:{ "project_id": "string", "branch": "string", "environment": "string" }
GET/deployments/:id

Get deployment status and logs

POST/deployments/:id/rollback

Rollback to a previous deployment

Request body:{}
DELETE/deployments/:id

Cancel an in-progress deployment

DOMAINS

GET/domains

List all custom domains

Query params: ?project_id=xxx&verified=true
POST/domains

Add a custom domain to your project

Request body:{ "domain": "string", "project_id": "string" }
GET/domains/:id

Get domain configuration and verification status

DELETE/domains/:id

Remove a custom domain

ENVIRONMENT VARIABLES

GET/projects/:id/env

List environment variables for a project

Query params: ?environment=production
POST/projects/:id/env

Create or update environment variables

Request body:{ "key": "string", "value": "string", "environment": "string[]" }
DELETE/projects/:id/env/:key

Delete an environment variable

LOGS

GET/logs

Retrieve application logs

Query params: ?project_id=xxx&since=1h&level=error
GET/logs/stream

Stream real-time logs via WebSocket

Query params: ?deployment_id=xxx

TEAMS

GET/teams

List all teams you belong to

POST/teams

Create a new team

Request body:{ "name": "string", "slug": "string" }
GET/teams/:id/members

List team members and their roles

POST/teams/:id/members

Invite a new team member

Request body:{ "email": "string", "role": "admin | member | viewer" }
DELETE/teams/:id/members/:user_id

Remove a team member

ANALYTICS

GET/analytics/traffic

Get traffic analytics for your projects

Query params: ?project_id=xxx&from=2025-01-01&to=2025-01-31
GET/analytics/performance

Get performance metrics and response times

Query params: ?project_id=xxx&period=7d
GET/analytics/errors

Get error rates and types

Query params: ?project_id=xxx&group_by=status_code

WEBHOOKS

GET/webhooks

List all configured webhooks

Query params: ?project_id=xxx
POST/webhooks

Create a new webhook endpoint

Request body:{ "url": "string", "events": "string[]", "project_id": "string" }
DELETE/webhooks/:id

Delete a webhook

Rate Limits

API rate limits vary by plan. All requests return rate limit headers.

FREE

1,000

requests per hour

• 60 requests per minute
• 24,000 daily limit
• Burst: 100 requests
Most Popular

PRO

50,000

requests per hour

• 1,000 requests per minute
• 1.2M daily limit
• Burst: 5,000 requests

ENTERPRISE

Custom

unlimited

• Custom rate limits
• Dedicated infrastructure
• SLA guarantees

Rate Limit Headers

X-RateLimit-Limit:1000
X-RateLimit-Remaining:847
X-RateLimit-Reset:1642521600

Need help?

Check out our documentation or reach out to our support team.