# ApiMappingOptions

Options for creating an api mapping.

- Source: [`aws-apigateway/lib/domain-name.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-apigateway/lib/domain-name.ts#L21)
- Type last changed: v2.47.0 · 20 Oct 2022

## Example

```ts
declare const acmCertificateForExampleCom: any;
declare const restApi: apigateway.RestApi;
declare const secondRestApi: apigateway.RestApi;

const domain = new apigateway.DomainName(this, 'custom-domain', {
  domainName: 'example.com',
  certificate: acmCertificateForExampleCom,
  mapping: restApi,
});

domain.addApiMapping(secondRestApi.deploymentStage, {
  basePath: 'orders/v2/api',
});
```

## Properties

- `basePath`: string — The api path name that callers of the API must provide in the URL after the domain name (e.g. `example.com/base-path`). If you specify this property, it can't be an empty string.

  **Default:** map requests from the domain root (e.g. `example.com`).

  If this is undefined, a mapping will be added for the empty path. Any request
  that does not match a mapping will get sent to the API that has been mapped
  to the empty path.
