Skip to content
Hoody.com

Route Management provides operations for inspecting and managing your project’s script routing layer. Use these endpoints to discover and resolve URL paths to handler scripts, generate OpenAPI specifications from user scripts, validate schema files, and manage imported SDKs.

Import, list, inspect, and remove SDKs that the routing layer can integrate with.

Returns every SDK registered with the routing layer, including file count and middleware presence.

This endpoint takes no parameters.

Terminal window
curl -X GET "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/sdk/list"
{
"sdks": [
{
"id": "sdk_a1b2c3d4e5f6",
"source_url": "https://github.com/acme/sdk-repo",
"files": 12,
"middleware": {
"pre": true,
"post": false
},
"marker": "// @hoody:sdk:marker"
}
],
"total": 1
}

Returns a single SDK by its identifier, including source metadata, middleware status, and file inventory.

NameInTypeRequiredDescription
idpathstringYesSDK identifier
Terminal window
curl -X GET "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/sdk/sdk_a1b2c3d4e5f6"
{
"id": "sdk_a1b2c3d4e5f6",
"type": "sdk",
"source_url": "https://github.com/acme/sdk-repo",
"path": "/scripts/sdk/sdk_a1b2c3d4e5f6",
"marker": "// @hoody:sdk:marker",
"middleware": {
"pre": {
"exists": true,
"path": "/scripts/sdk/sdk_a1b2c3d4e5f6/_middleware.pre.ts",
"hash": "a1b2c3d4e5f67890"
},
"post": {
"exists": false,
"path": null,
"hash": null
}
},
"files": {
"total": 12,
"endpoints": 8,
"list": []
}
}

Imports an SDK from a remote source URL into the routing layer, downloading and indexing its files.

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
execIdstringYes-Identifier of the execution container the SDK is imported into
source_urlstringYes-Remote URL of the SDK repository or tarball
source_authstringNo-Optional authentication header or token for the source
middlewarestringNo-Middleware configuration for the imported SDK
magic_commentsstringNo-Magic comment directives applied during import
forcebooleanNofalseForce re-import when the SDK already exists
Terminal window
curl -X POST "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/sdk/import" \
-H "Content-Type: application/json" \
-d '{
"execId": "exec-1",
"source_url": "https://github.com/acme/sdk-repo",
"force": false
}'
{
"action": "imported",
"summary": {
"new": 5,
"updated": 2,
"conflicts": 0,
"total": 7
},
"sdk": {
"id": "sdk_a1b2c3d4e5f6",
"source_url": "https://github.com/acme/sdk-repo",
"path": "/scripts/sdk/sdk_a1b2c3d4e5f6",
"files": {
"endpoints": 8,
"pre": "_middleware.pre.ts",
"post": "_middleware.post.ts",
"marker": "_marker.ts"
}
}
}

Removes an SDK from the routing layer, deleting its marker and all associated files.

NameInTypeRequiredDescription
idpathstringYesSDK identifier
Terminal window
curl -X DELETE "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/sdk/sdk_a1b2c3d4e5f6"
{
"message": "SDK deleted",
"removed": {
"marker": "// @hoody:sdk:marker",
"files": 12,
"directory": "/scripts/sdk/sdk_a1b2c3d4e5f6"
}
}

Resolve URL paths to handler scripts and batch-test routing behavior. All three endpoints use Next.js-style dynamic routing (static, [param], [...slug], [[...path]]) with priority static > dynamic > catch-all > optional catch-all.

Scans a script directory for .js and .ts files and returns every route pattern, classified by Next.js-style type. Each entry includes the route pattern, file path, route type, and extracted parameter names. Set includeMetadata to also receive file size and modification time.

This endpoint takes no parameters.

FieldTypeRequiredDefaultDescription
baseDirstringNo""Base directory to scan, absolute or relative to the scripts directory
includeMetadatabooleanNofalseWhen true, include file size and modification time for each route
Terminal window
curl -X POST "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/route/discover" \
-H "Content-Type: application/json" \
-d '{
"baseDir": "scripts",
"includeMetadata": true
}'
{
"baseDir": "scripts",
"count": 3,
"routes": [
{
"pattern": "/api/users",
"filePath": "scripts/api/users.ts",
"type": "static",
"params": []
},
{
"pattern": "/api/users/:id",
"filePath": "scripts/api/users/[id].ts",
"type": "dynamic",
"params": ["id"]
},
{
"pattern": "/api/files/:path*",
"filePath": "scripts/api/files/[...path].ts",
"type": "catchall",
"params": ["path"]
}
]
}

Resolves a single URL path to the script file that would handle it. Resolution is scoped by hostname and execId and checks, in order: {hostname}/{execId}/, {hostname}/, {execId}/, and the root.

This endpoint takes no parameters.

This endpoint accepts a JSON request body. Specific field shapes are defined by the implementation.

Terminal window
curl -X POST "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/route/resolve" \
-H "Content-Type: application/json" \
-d '{}'
{
"matched": true,
"path": "scripts/api.example.com/exec-1/users.ts",
"hostname": "api.example.com",
"execId": "exec-1",
"triedDirectories": [
"scripts/api.example.com/exec-1",
"scripts/api.example.com",
"scripts/exec-1",
"scripts"
]
}

Tests multiple URL paths against the routing system in a single batch request. For each path, returns the resolved script, extracted parameters, and route type. The aggregate matched and notMatched counts are included.

This endpoint takes no parameters.

This endpoint accepts a JSON request body. Specific field shapes are defined by the implementation.

Terminal window
curl -X POST "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/route/test" \
-H "Content-Type: application/json" \
-d '{}'
{
"tested": 2,
"matched": 1,
"notMatched": 1,
"results": [
{
"url": "/api/users/42",
"matched": true,
"script": "scripts/api/users/[id].ts",
"params": { "id": "42" },
"type": "dynamic"
},
{
"url": "/api/products/42",
"matched": false,
"script": null,
"params": {},
"type": null
}
]
}

List user scripts, serve their schemas, and generate, merge, or validate OpenAPI specifications derived from them.

Lists available scripts under the configured scripts directory along with per-script schema metadata, route path, and extracted path parameters.

NameInTypeRequiredDescription
directoryquerystringNoScript directory to list (absolute or relative to scripts-dir). Default: scripts.
dirquerystringNoAlias of directory. Ignored when directory is provided.
subdomainquerystringNoLimit scan to scripts under this subdomain. Falls back to the Host header when omitted.
execIdquerystringNoLimit scan to scripts under this execId. Falls back to the Host header when omitted.
Terminal window
curl -X GET "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/user-openapi/list?directory=api"
{
"success": true,
"data": {
"directory": "api",
"totalScripts": 2,
"withSchemas": 2,
"scripts": [
{
"path": "api/users/index.ts",
"routePath": "/api/users",
"hasSchema": true,
"schemaFormat": "zod",
"pathParameters": []
},
{
"path": "api/users/[id].ts",
"routePath": "/api/users/:id",
"hasSchema": true,
"schemaFormat": "zod",
"pathParameters": ["id"]
}
]
}
}

Serves the schema file (Zod or JSON Schema) for a specific user script directly, without rendering the surrounding route metadata.

NameInTypeRequiredDescription
filequerystringNoAbsolute or scripts-dir-relative path to the target script (e.g. default/api/users/[id].ts). Either file or path must be provided.
pathquerystringNoAlias of file. Either file or path must be provided.
Terminal window
curl -X GET "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/user-openapi/schema?file=default/api/users/%5Bid%5D.ts"
{
"type": "object",
"properties": {
"name": { "type": "string" },
"age": { "type": "number" }
},
"required": ["name"]
}

Generates and serves the OpenAPI specification on-the-fly from the user scripts directory. Use format=yaml to receive YAML instead of JSON.

NameInTypeRequiredDescription
dirquerystringNoScript directory to scan (absolute or relative to scripts-dir). Default: scripts.
directoryquerystringNoAlias of dir. Ignored when dir is provided.
formatquerystringNoOutput format. json (default) or yaml.
subdomainquerystringNoLimit scan to scripts under this subdomain. Falls back to the Host header when omitted.
execIdquerystringNoLimit scan to scripts under this execId. Falls back to the Host header when omitted.
Terminal window
curl -X GET "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/user-openapi/spec?dir=api&format=json"
{
"openapi": "3.0.0",
"info": {
"title": "User API",
"version": "1.0.0"
},
"paths": {
"/api/users": {
"get": {
"summary": "List users"
}
}
}
}

Generates an OpenAPI specification from user scripts and returns it together with generation metadata.

This endpoint takes no parameters.

This endpoint accepts a JSON request body. Specific field shapes are defined by the implementation.

Terminal window
curl -X POST "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/user-openapi/generate" \
-H "Content-Type: application/json" \
-d '{}'
{
"success": true,
"data": {
"openapi": "3.0.0",
"info": {
"title": "User API",
"version": "1.0.0"
},
"paths": {}
},
"meta": {
"pathCount": 8,
"scanDirectory": "scripts",
"generatedAt": "2025-01-15T10:30:00.000Z"
}
}

Merges multiple OpenAPI specifications into a single combined specification.

This endpoint takes no parameters.

This endpoint accepts a JSON request body. Specific field shapes are defined by the implementation.

Terminal window
curl -X POST "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/user-openapi/merge" \
-H "Content-Type: application/json" \
-d '{}'
{
"success": true,
"data": {
"openapi": "3.0.0",
"info": {
"title": "Merged API",
"version": "1.0.0"
},
"paths": {}
}
}

Validates a single script’s schema file and returns any validation errors. Use this endpoint to check whether a schema is well-formed before generating a spec.

This endpoint takes no parameters.

This endpoint accepts a JSON request body. Specific field shapes are defined by the implementation.

Terminal window
curl -X POST "https://acme-prod-abc123-exec-1.eu-west-1.containers.hoody.icu/api/v1/exec/user-openapi/validate" \
-H "Content-Type: application/json" \
-d '{}'
{
"success": true,
"data": {
"valid": true
},
"errors": []
}