Relpin can describe app-owned endpoints as an API surface. This is useful for Studio inspection, generated reference, and OpenAPI-compatible tooling.
Define an endpoint
import { defineApiEndpoint, defineApiSurface } from '@app-builder-platform/relpin-sdk/api'
const listOrders = defineApiEndpoint({
method: 'GET',
path: '/api/orders',
summary: 'List orders',
tags: ['orders'],
responses: [{ status: 200, description: 'Orders returned' }],
})
export const apiSurface = defineApiSurface({
title: 'Orders app',
runtime: 'node',
endpoints: [listOrders],
})
Convert to OpenAPI
The SDK can convert a Relpin API surface to an OpenAPI document. Use this for app-owned endpoints, not as a claim that Relpin exposes a public platform API during beta.
Keep metadata close to routes
When possible, keep route descriptions near the route implementation. That keeps docs and runtime behavior easier to review together.