Docs

spec

OpenAPI specification for the Aptos REST API

Overview

Open the Aptos REST API explorer page served by the node. On Dwellir Aptos mainnet, /v1/spec returns an interactive Stoplight HTML document rather than a raw JSON or YAML OpenAPI payload.

Endpoint

GET /v1/spec

Code Examples

Integration with Development Tools

Browser Explorer

Use the returned page as a human-facing explorer in a browser tab. If you need machine-readable schemas for code generation, source them from a verified raw spec artifact rather than /v1/spec.

Use Cases

  1. Interactive API Exploration: Open the embedded Stoplight page to browse endpoints, request examples, and schemas manually.
  2. Onboarding and Support: Share one URL with developers who need to inspect the REST surface without installing extra tooling.
  3. Quick Endpoint Discovery: Verify paths, parameters, and response descriptions while debugging integrations.

Best Practices

Version Pinning: The specification matches the API version of the node you are querying. For production applications, pin to a specific specification version and test thoroughly before upgrading.

Caching: The specification changes only when the node software is upgraded. Cache it locally during development rather than fetching on every build. Re-fetch when you detect node version changes via the git_hash field in ledger info.

Format Selection: On Dwellir Aptos mainnet, /v1/spec returns HTML even when you request JSON. Do not treat this endpoint as a raw OpenAPI download target for parsers or code generators.

Performance Considerations

The explorer document is moderately large and rarely changes. Cache it locally if you need an offline copy for documentation review.

This endpoint does not touch blockchain state. Response times are primarily driven by serving the static HTML explorer page and its embedded assets.

Avoid fetching the explorer at application runtime unless you are explicitly linking users to documentation.

  • Aptos TypeScript SDK (@aptos-labs/ts-sdk) uses this specification as a basis for type definitions
  • OpenAPI Generator documentation at openapi-generator.tech
  • OpenAPI 3.0 specification documentation at swagger.io
  • /v1 - Get ledger info including node software version