# apigateway-v2 — API Gateway v2 (HTTP & WebSocket)

A zero-dependency, in-process emulator for AWS API Gateway v2 (HTTP and
WebSocket APIs).

| Property | Value                 |
| -------- | --------------------- |
| Port     | 4714                  |
| Protocol | REST / JSON           |
| Health   | `GET /_parlel/health` |
| Reset    | `POST /_parlel/reset` |

> This is a separate service from the legacy `apigateway` stub (port 4579) and
> from `apigateway-v1` (port 4715, REST APIs).

## Default connection

```
AWS_ENDPOINT_URL=http://127.0.0.1:4714
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=parlel
AWS_SECRET_ACCESS_KEY=parlel
```

## Supported operations

| Operation         | Path                                   |
| ----------------- | -------------------------------------- |
| CreateApi         | `POST /v2/apis`                        |
| GetApis           | `GET /v2/apis`                         |
| GetApi            | `GET /v2/apis/{id}`                    |
| DeleteApi         | `DELETE /v2/apis/{id}`                 |
| CreateRoute       | `POST /v2/apis/{id}/routes`            |
| GetRoutes         | `GET /v2/apis/{id}/routes`             |
| CreateIntegration | `POST /v2/apis/{id}/integrations`      |
| GetIntegrations   | `GET /v2/apis/{id}/integrations`       |
| CreateStage       | `POST /v2/apis/{id}/stages`            |
| GetStages / Stage | `GET /v2/apis/{id}/stages[/{name}]`    |
| CreateDeployment  | `POST /v2/apis/{id}/deployments`       |
| GetDeployments    | `GET /v2/apis/{id}/deployments`        |

`ProtocolType` may be `HTTP` or `WEBSOCKET`; WebSocket APIs require a
`RouteSelectionExpression`. Integration types: `AWS_PROXY`, `HTTP_PROXY`,
`MOCK`, `AWS`, `HTTP`.

## SDK usage example

```ts
import {
  ApiGatewayV2Client,
  CreateApiCommand,
} from "@aws-sdk/client-apigatewayv2";

const apigw = new ApiGatewayV2Client({
  endpoint: "http://127.0.0.1:4714",
  region: "us-east-1",
  credentials: { accessKeyId: "parlel", secretAccessKey: "parlel" },
});

await apigw.send(new CreateApiCommand({ Name: "my-api", ProtocolType: "HTTP" }));
```

## Access via MCP / preview URL

Point any AWS SDK or MCP tool at the allocated preview URL via
`AWS_ENDPOINT_URL`.

## Surface coverage

This emulator faithfully replicates the API surface most application code and agents exercise. Anything below the supported lines is either an intentional design choice for a fast, zero-cost local emulator (✓ By design) or a candidate for a future release (⟳ Roadmap) — never a silent inaccuracy.

Legend: ✅ fully supported · ◐ accepted (stored, not strictly enforced) · ✓ by design · ⟳ on the roadmap.

| Area              | Limitation                                       |
| ----------------- | ------------------------------------------------ |
| Request execution | No actual request routing/invocation             |
| Authorizers       | Not implemented                                  |
| Update operations | Update/patch operations are not implemented      |
| Custom domains    | Not supported                                    |
| State             | In-memory only; lost on restart                  |
