Endpoint mapping contract
Pulse Routing
Pulse routing defines how source files map to same-origin /api routes and how those routes are exposed to runtime callers, embeds, and automation surfaces.
Route contract reference for mapping Pulse files to API endpoints.
Implementation focus
Use this page when creating or refactoring server routes so call paths and deployment behavior remain predictable.
Expected outcomes
- Map source layout to stable /api route contracts.
- Avoid route collisions during iterative releases.
- Preserve clear ownership across handler files and surfaces.
File-to-route mapping
Pulse routing maps server-side source files to same-origin /api endpoints. The route shape should be predictable enough that vibe code, embeds, docs, and automation can call it without guessing where behavior lives.
Route collisions and unclear ownership become production bugs quickly. Name endpoints around behavior and keep handler files close to the capability they own.
- Keep Pulse routes stable once public callers depend on them.
- Avoid overlapping route names with different auth expectations.
- Document payload shape and error behavior for each public endpoint.
Exposure model
A deployed Pulse endpoint can be public HTTP while the source remains private. Those are different visibility planes. Do not rely on source privacy as endpoint access control.
If a route should be owner-only, signed, or session-gated, enforce that in the handler.
- Public callable does not mean public source.
- Public source does not mean safe to expose secrets.
- Runtime routing should not leak platform capabilities, deployment details, or logs.
Example and read next
Example: server/contact.ts should become a stable same-origin route such as /api/contact. Keep route names intentional, avoid collisions, and update callers when the route contract changes.
Use these related pages when you need the next layer of guidance. They point to the most likely follow-up tasks, not every page that happens to touch the same system.
- Read next: Pulse SDK & Handlers (/docs/handlers)
- Read next: Calling Pulses (/docs/calling-pulses)
- Read next: Vibes & Pulses (/docs/vibes-pulses)
- Read next: How-To Guides (/docs/how-to)