Carregando Serverfy API Reference...
Serverfy RESTful API provides a high-performance, securely isolated interface per Workspace to provision cloud servers, manage sites, configure databases, and interact with webhooks programmatically.
Cloud server provisioning on DigitalOcean, Hetzner, AWS, Linode, and Vultr, real-time CPU metric tracking, and SSH key management.
Creation of Laravel, Node.js, or static sites, automated SSL certificate lifecycle management (Let's Encrypt / On-Demand TLS), and zero-downtime deployments.
Provisioning of MySQL, PostgreSQL, and Redis, user credential management, and atomic Instant DB Snapshots before each schema migration.
Proactive infrastructure incident diagnosis, root-cause analysis, and supervised Quick Fix proposals (Human-in-the-Loop).
Real-time telemetry, p50/p95/p99 latency, exception aggregation with stack tracing, unified live logs, and Slow Query optimization.
Control servers and deployments via natural language directly from Claude Code, Cursor, Antigravity, and modern IDEs.
URL Base: https://serverfy.io/api/v1 Formato: application/json (UTF-8) Default: RESTful / JSON Payload
The API has a default limit of 100 requests per minute per Workspace. All responses include X-RateLimit-Limit and X-RateLimit-Remaining headers. Requests exceeding the limit will receive HTTP status 429 Too Many Requests.
| Code | Meaning | Description |
|---|---|---|
200 OK |
Success | The request was processed and returned successfully. |
201 Created |
Created | The resource (server, site, database, or deployment) was created successfully. |
400 Bad Request |
Invalid Request | The request body or submitted parameters are malformed. |
401 Unauthorized |
Unauthorized | API Key (Bearer Token) missing, invalid, or revoked. |
403 Forbidden |
Forbidden | The Workspace lacks sufficient privileges to execute this action on the resource. |
404 Not Found |
Not Found | The requested resource does not exist or does not belong to this Workspace. |
422 Unprocessable |
Validation Error | Required fields missing or failing validation rules. |
429 Rate Limit |
Rate Limit Exceeded | Rate limit of 100 requests per minute per Workspace reached. |
500 Server Error |
Server Error | Internal execution error. Please check server logs or contact support. |
The Serverfy API uses Bearer Tokens (Personal Access Tokens) managed by Laravel Sanctum, ensuring cryptographic isolation per Workspace and strict permission enforcement.
In the application sidebar, click Workspace > API Keys or access it directly from the console.
Click the button "New API Key" at the top of the key list.
Assign a clear name describing the purpose of the integration (e.g.: CI/CD Deployments, Local MCP Agent, Backup Sync).
Copy the token immediately. For security reasons, the full token is only displayed once at the time of creation.
Authorization: Bearer 1|abcdef1234567890abcdef1234567890 Accept: application/json Content-Type: application/json
curl -X GET "https://serverfy.io/api/v1/servers" \ -H "Authorization: Bearer SEU_TOKEN_AQUI" \ -H "Accept: application/json"
If the API key is missing, incorrect, or revoked, the API responds with HTTP status 401:
{ "message": "Unauthenticated." }
Serverfy natively supports the Model Context Protocol (MCP), allowing modern AI assistants — such as Claude Code, Claude Desktop, Cursor, and Antigravity — to connect directly to your Workspace infrastructure.
By enabling the MCP connection, AI models receive strict capabilities (Tools) to inspect metrics, trigger zero-downtime deployments with atomic rollback, and restart services in a safe, auditable, and isolated manner.
In the Serverfy panel, generate a Personal Access Token with appropriate permissions.
The generated token will serve as your Bearer Token for authenticating with the MCP SSE server.
Configure the client by passing the header AUTHORIZATION: Bearer SEU_TOKEN in the environment variables.
To connect Serverfy to Anthropic's Claude, open the configuration file ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows) and add the server via SSE:
{ "mcpServers": { "serverfy": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-sse", "https://serverfy.io/api/v1/mcp/sse" ], "env": { "AUTHORIZATION": "Bearer SEU_TOKEN_AQUI" } } } }
The Serverfy MCP server exposes a complete catalog of granular, secure, and audited tools for AI copilots.
list_serversLists provisioned servers, cloud providers (AWS, DO, Hetzner, Vultr), and connectivity status.
list_sitesLists applications, domains, active branches, runtime, and current status for each workspace site.
deploy_siteTriggers atomic zero-downtime deployment with health check and automatic rollback on failure.
read_server_metricsGets real-time telemetry for CPU, RAM, disk usage, and historical time series from 1h to 7 days.
restart_workerRestarts background workers (Supervisor/Horizon) with graceful shutdown of active queues.
promote_staging_sitePromotes staging environment or ephemeral PR preview to production with database synchronization.
manage_site_cacheConfigures FastCGI/Caddy micro-caching rules, TTL, bypass for authenticated sessions, and HTTP headers.
purge_fastcgi_cacheInstantly purges in-memory and disk cache for an application without restarting the web server.
manage_site_hibernationHibernates inactive sites or restores applications on demand with a hold proxy, freeing memory and CPU.
manage_telemetryConfigures log retention, Sentinel Sense metrics, and percentile latency alerts (p95/p99).
manage_load_balancerManages multi-node upstream pools, load balancing policies (round-robin, least-conn), and health checks.
list_database_replicasQueries read replicas configured for MySQL/PostgreSQL and replication lag (seconds behind master).
create_database_replicaProvisions and synchronizes a new database replica with streaming replication on secondary nodes.
promote_database_replicaPromotes secondary replica to primary node in case of maintenance or failover.
manage_backup_replicationConfigures cross-provider backup replication across multiple S3, Backblaze B2, and Wasabi destinations.
evaluate_dns_failoverChecks Cloudflare/Route53 zone health and performs automatic traffic failover from degraded nodes.
list_centurion_proposalsLists autonomous server optimization proposals generated by Centurion AI Copilot pending approval.
approve_centurion_proposalApproves and executes AI-recommended action plan with full audit tracking.
reject_centurion_proposalDismisses action proposal with technical rationale logged for copilot learning.
run_centurion_watchdogTriggers on-demand scan for zombie processes, port locks, and CPU overload.
run_compliance_scanExecutes CIS Benchmark audit and validates SSH permissions, UFW firewall, and runtime versions.
remediate_compliance_issueApplies automatic remediation for compliance failures identified in the security report.
With MCP configured in Claude or Cursor, you can ask things like: "Deploy staging site to web-01 server" or "Analyze Nginx error logs from the past 15 minutes and tell me which endpoint is failing".
Unified observability and self-healing for servers and apps: p50/p95/p99 latency telemetry, smart exception tracking, unified live logs, early incident detection, and automated Slow Query optimization.
Continuous anomaly diagnostics (OOM Killers, crash loops, PHP-FPM pool saturation) and actionable Quick Fix recommendations with human approval.
HTTP latency histograms and percentiles (p50, p95, and p99), throughput rate (req/s), and real-time status code grouping with zero overhead.
Monitoring of slow SQL queries (>100ms) and N+1 detection, offering structured EXPLAIN plans and ready-to-use index creation migrations.
Automatic capture and aggregation of unhandled errors and exceptions with full stack trace, sanitized environment variables, and occurrence history.
The Serverfy agent collects system and application metrics and dispatches them periodically. You can also integrate custom monitoring pipelines via authenticated API endpoints:
curl -X POST "https://serverfy.io/api/v1/telemetry/ingest" \ -H "Authorization: Bearer SEU_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "server_id": "srv-01", "metrics": { "cpu_usage": 23.4, "memory_used_mb": 1840, "http_p95_ms": 112 } }'
Sentinel AI never applies structural or destructive changes without explicit authorization. Upon detecting an incident, it identifies the root cause and provides the action for Quick Fix for you to execute with a single click.
Comprehensive infrastructure shielding against data loss and downtime: automatic Instant DB Snapshots before every deploy with instant rollback, cross-cloud replication across multiple storage providers, and intelligent worker autoscaling.
Creation of an instant database restore point prior to running migrations. If the release fails, revert to the exact pre-deploy state with 1 click.
Simultaneous backup distribution across multiple independent providers (AWS S3, Cloudflare R2, and DigitalOcean Spaces), eliminating vendor lock-in.
Dynamic scaling of Supervisor queue processes and PHP/Redis workers based on queue latency and real-time backlog count.
Dynamic and automatic SSL certificate issuance for custom customer domains in SaaS platforms, protected by Ask URL validation.
curl -X POST "https://serverfy.io/api/v1/databases/db-prod-01/snapshots" \ -H "Authorization: Bearer SEU_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "pre-migration-v2.5", "replicate_cross_cloud": true }'
Native integration with cloud DNS providers to automate domain validation, root A records, CAA issuance records for Let's Encrypt SSL, and wildcard routing across all provisioned servers.
Automated record provisioning using dedicated IAM access keys with granular zone-level permissions.
Scoped API tokens restricted to Zone:DNS edit capabilities for enterprise and personal domains.
Direct domain synchronization using DigitalOcean Personal Access Tokens with write privilege.
For security, never use AWS root account keys. Create a dedicated IAM user with specific Route 53 permissions.
Navigate to IAM > Users > Create User. Set username as serverfy-route53 and select Attach policies directly.
Attach the AmazonRoute53FullAccess policy or apply the least-privilege JSON policy shown below.
Under Security Credentials, click Create Access Key. Select Third-party service and copy Access Key ID and Secret Access Key.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "route53:ListHostedZones", "route53:GetHostedZone", "route53:ListResourceRecordSets", "route53:ChangeResourceRecordSets", "route53:GetChange" ], "Resource": "*" } ] }
In Cloudflare, always use a scoped API Token with Zone:DNS Edit and Zone:Zone Settings Edit permissions instead of the Global API Key.
Open dash.cloudflare.com/profile/api-tokens and click Create Token.
Grant Zone > DNS > Edit (to manage A, CAA records & enable orange cloud proxy) and Zone > Zone Settings > Edit (to automate Full Strict SSL and Always Use HTTPS without redirect loops).
Save the generated token and paste it into Workspace > DNS Providers > Cloudflare.
Generate a Personal Access Token in DigitalOcean with Read and Write permissions to enable full DNS zone management.
Go to cloud.digitalocean.com/account/api/tokens and click Generate New Token.
Set token name (e.g. serverfy-dns) and ensure Write scope is enabled.