REST API Reference

Complete REST API documentation for the Vastal platform

The Vastal REST API provides programmatic access to all platform functionality. All API endpoints use HTTPS and require authentication.

Base URL

https://api.vastal.com/v1

Authentication

All API requests must include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Response Format

All responses are in JSON format:

{
  "success": true,
  "data": {...},
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 150
  }
}

Error Handling

Error responses include status codes and detailed messages:

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid field value",
    "details": {
      "field": "email",
      "reason": "Invalid email format"
    }
  }
}

Common Status Codes

CodeDescription
200Success
201Created
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found
429Rate Limited
500Internal Server Error

Pagination

List endpoints support pagination with the following query parameters:

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger50Items per page (max: 100)

Available Endpoints

Tables

  • GET /tables - List all tables
  • GET /tables/{table_id} - Get table details
  • POST /tables - Create a new table
  • PATCH /tables/{table_id} - Update table
  • DELETE /tables/{table_id} - Delete table

Rows

  • GET /tables/{table_id}/rows - List rows
  • GET /tables/{table_id}/rows/{row_id} - Get single row
  • POST /tables/{table_id}/rows - Create row
  • PATCH /tables/{table_id}/rows/{row_id} - Update row
  • DELETE /tables/{table_id}/rows/{row_id} - Delete row

Webhooks

  • GET /webhooks - List webhooks
  • POST /webhooks - Create webhook
  • PATCH /webhooks/{webhook_id} - Update webhook
  • DELETE /webhooks/{webhook_id} - Delete webhook

Domains

  • GET /domains - List domains
  • POST /domains - Add domain
  • GET /domains/{domain_id}/verify - Verify domain DNS
  • DELETE /domains/{domain_id} - Remove domain

SDK Examples

JavaScript/TypeScript

import { VastalClient } from '@vastal/api';

const client = new VastalClient({
  apiKey: 'vst_xxxxxxxxxxxxxxxxxxxxxxxx'
});

// List tables
const tables = await client.tables.list();

// Create a row
const row = await client.tables.rows.create('contacts', {
  data: {
    name: 'John Doe',
    email: 'john@example.com'
  }
});

Python

from vastal import VastalClient

client = VastalClient(api_key='vst_xxxxxxxxxxxxxxxxxxxxxxxx')

# List tables
tables = client.tables.list()

# Create a row
row = client.tables.rows.create('contacts', {
    'name': 'John Doe',
    'email': 'john@example.com'
})

Next Steps