API Documentation

Welcome to the TerraClaw API. This RESTful API allows you to programmatically manage projects, scenes, and exports.

Base URL: https://api.terraclaw.io/v1

Rate Limit: 100 requests per minute for Pro users

Introduction

The TerraClaw API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Authentication

Authentication to the TerraClaw API is performed using Bearer tokens. You can generate API keys from your Account Settings.

POST /auth/token

Exchange credentials for an access token.

curl -X POST https://api.terraclaw.io/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "your-password"}'

Projects

Projects are containers for your urban modeling work. Each project can contain multiple scenes.

GET /projects Pro

List all projects for the authenticated user.

curl https://api.terraclaw.io/v1/projects \
  -H "Authorization: Bearer YOUR_API_KEY"
POST /projects Pro

Create a new project.

curl -X POST https://api.terraclaw.io/v1/projects \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Berlin Development", "location": {"lat": 52.52, "lng": 13.405}}'

Scenes

Scenes represent individual 3D modeling environments within a project.

GET /projects/:projectId/scenes Pro

List all scenes in a project.

POST /projects/:projectId/scenes Pro

Create a new scene in a project.

Exports

Export your scenes to various formats for use in BIM and CAD software.

POST /exports/request Pro

Request an export of a scene in the specified format.

curl -X POST https://api.terraclaw.io/v1/exports/request \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sceneId": "scene_123", "format": "ifc"}'

Supported Formats

Urban Intelligence

Pro

AI-powered analysis and generation endpoints for urban planning.

POST /intelligence/analyze-site

Analyze a site's urban grain and context compatibility.

POST /intelligence/generate-massing

Generate AI-powered massing proposals based on site constraints.

Errors

The TerraClaw API uses standard HTTP response codes to indicate the success or failure of requests.

Code Description
200 Success
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing API key
403 Forbidden - Insufficient permissions
404 Not Found - Resource doesn't exist
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error

Need Help?

For API support, contact us at api@terraclaw.io or visit our Help Center.