This quickstart guide gets you from zero to a working API call in just a few minutes. By the end, you will have authenticated with the API and retrieved your server list.
Prerequisites
- A Data Mammoth account with at least one server (or the intent to create one).
- An API key. See API Authentication if you do not have one yet.
- A tool for making HTTP requests:
curl(command line), Postman (GUI), or a programming language.
Step 1 — Get Your API Key
dm_key_abc123def456.Step 2 — Make Your First Request
Using cURL
Open your terminal and run:
bash
curl -X GET "https://api.datamammoth.com/v1/account" \
-H "Authorization: Bearer dm_key_abc123def456" \
-H "Content-Type: application/json"Expected Response
json
{
"data": {
"id": "acc_12345",
"email": "[email protected]",
"name": "Jane Doe",
"company": "Acme Inc",
"created_at": "2025-06-15T10:00:00Z"
}
}If you see your account details, your API key is working correctly.
Step 3 — List Your Servers
bash
curl -X GET "https://api.datamammoth.com/v1/servers" \
-H "Authorization: Bearer dm_key_abc123def456" \
-H "Content-Type: application/json"Response:
json
{
"data": [
{
"id": "srv_abc123",
"name": "web-production",
"status": "running",
"ip": "203.0.113.10",
"plan": "vps-standard",
"region": "us-east",
"os": "ubuntu-24.04"
}
],
"meta": {
"total": 1,
"page": 1,
"per_page": 25
}
}Step 4 — Get Server Details
Use a server ID from the list to get full details:
bash
curl -X GET "https://api.datamammoth.com/v1/servers/srv_abc123" \
-H "Authorization: Bearer dm_key_abc123def456" \
-H "Content-Type: application/json"Response:
json
{
"data": {
"id": "srv_abc123",
"name": "web-production",
"status": "running",
"ip": "203.0.113.10",
"ipv6": "2001:0db8:85a3::1",
"plan": "vps-standard",
"region": "us-east",
"os": "ubuntu-24.04",
"vcpus": 4,
"ram_mb": 8192,
"disk_gb": 160,
"bandwidth_tb": 5,
"created_at": "2026-01-15T10:30:00Z",
"tags": ["production", "web"]
}
}Step 5 — Perform a Server Action
Restart a server:
bash
curl -X POST "https://api.datamammoth.com/v1/servers/srv_abc123/actions" \
-H "Authorization: Bearer dm_key_abc123def456" \
-H "Content-Type: application/json" \
-d '{
"action": "restart"
}'Response:
json
{
"data": {
"action_id": "act_xyz789",
"action": "restart",
"status": "in_progress",
"started_at": "2026-03-17T14:30:00Z"
}
}Common API Patterns
Filtering Results
Add query parameters to filter:
bash
curl -X GET "https://api.datamammoth.com/v1/servers?status=running®ion=us-east" \
-H "Authorization: Bearer dm_key_abc123def456"Pagination
Navigate large result sets:
bash
curl -X GET "https://api.datamammoth.com/v1/servers?page=2&per_page=10" \
-H "Authorization: Bearer dm_key_abc123def456"See API Pagination & Filtering for details.
Error Handling
If something goes wrong, the API returns an error:
json
{
"error": {
"code": "not_found",
"message": "Server 'srv_invalid' not found.",
"status": 404
}
}See API Error Codes & Handling for a complete reference.
Next Steps with the API
Now that you have made your first API calls, explore these capabilities:
| Task | Endpoint | Method |
|---|---|---|
| Create a server | /v1/servers | POST |
| Delete a server | /v1/servers/{id} | DELETE |
| List invoices | /v1/billing/invoices | GET |
| Create a support ticket | /v1/support/tickets | POST |
| Set up a webhook | /v1/webhooks | POST |
Code Examples
For implementation in your preferred programming language:
What to Do Next
- Server Management API — Full server API reference.
- Billing API — Automate billing operations.
- API Rate Limits & Best Practices — Optimize your usage.
- Webhooks — Receive real-time event notifications.