Reference > Extensions > Api
Api Extensions Reference
Reference for all Api.* extensions available in webiny.config.tsx.
WHAT YOU'LL LEARN
- every
Api.*extension and the props it accepts
Overview
Api.* extensions customize the API Lambda — loading custom code, registering HTTP routes, and passing build-time parameters into the bundle.
Api.Extension
Registers a custom extension on the API Lambda (GraphQL schema factories, event handlers, use cases, etc.).
| Prop | Type | Required | Description |
|---|---|---|---|
src | string | Yes | Path to the extension file |
exportName | string | No | Export name to use. Defaults to the filename without extension. |
Can be used multiple times.
Api.Route
Registers a custom HTTP route on the API Gateway and GraphQL Lambda. See Add Custom API Routes for a full guide.
| Prop | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Route path, must start with /. Use {paramName} for path parameters. |
method | string | Yes | HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, or ANY |
src | string | Yes | Path to the route handler file, including the .ts extension |
routeName | string | No | Pulumi resource name (kebab-case). Auto-derived from path and method if omitted. |
Can be used multiple times.
Adding or removing a route requires yarn webiny deploy api — route registration modifies API Gateway configuration.
Api.BuildParam
Passes a build-time parameter into the API Lambda bundle, accessible via BuildParams at runtime.
| Prop | Type | Required | Description |
|---|---|---|---|
paramName | string | Yes | Parameter name |
value | string \| number \| boolean \| object \| array | Yes | Parameter value |
Can be used multiple times.