Generic Templates
The generic template endpoints let you run calculations for any calculation template available on Calcs.com, without needing a dedicated typed endpoint.
For templates with dedicated endpoints (like Timber Beam or Snow Load), those typed endpoints provide richer validation and documented schemas. Use the generic endpoints when no typed endpoint exists, or when you want a uniform interface across template types.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /v1/templates | List all available templates |
GET | /v1/templates/{code} | Get template details and input fields |
GET | /v1/templates/{code}/presets | Get available presets for a template |
POST | /v1/templates/{code}/calculate | Run a calculation |
POST | /v1/templates/{code}/validate | Validate inputs without calculating |
Quick Example
1. Discover templates
Code
2. Inspect a template
Code
This returns the template's input fields (with reference IDs, types, and defaults) and available presets.
3. Run a calculation
Code
The response includes a sheetId, the resolved inputs, and results whose format depends on the template's configured API outputs.
Key Concepts
Template codes identify calculation types (e.g., timberBeamASD, loadsSnowASCE7-22). Use GET /v1/templates to discover available codes.
Attributes use widget reference IDs from the template, not API-specific field names. Use GET /v1/templates/{code} to see the expected fields.
Presets apply sensible defaults before your attributes, reducing the number of fields you need to set. Use GET /v1/templates/{code}/presets to see what's available.
Validation can be done as a pre-flight check via POST /v1/templates/{code}/validate before committing to a full calculation.
Next Steps
- API Reference - Full endpoint documentation with schemas
- Timber Beam Guide - Typed endpoint with richer validation
- Snow Load Guide - Typed snow load endpoint