# CallApiGatewayRestApiEndpointOptions

Base properties for calling an REST API Endpoint.

- Source: [`aws-stepfunctions-tasks/lib/apigateway/call-rest-api.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/apigateway/call-rest-api.ts#L13)
- Type last changed: v2.179.0 · 18 Feb 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigateway as apigateway } from 'aws-cdk-lib';
import { aws_stepfunctions_tasks as stepfunctions_tasks } from 'aws-cdk-lib';

declare const restApi: apigateway.RestApi;
const callApiGatewayRestApiEndpointOptions: stepfunctions_tasks.CallApiGatewayRestApiEndpointOptions = {
  api: restApi,
  stageName: 'stageName',

  // the properties below are optional
  region: 'region',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apigateway as apigateway
from aws_cdk import aws_stepfunctions_tasks as stepfunctions_tasks

# rest_api: apigateway.RestApi

call_api_gateway_rest_api_endpoint_options = stepfunctions_tasks.CallApiGatewayRestApiEndpointOptions(
    api=rest_api,
    stage_name="stageName",

    # the properties below are optional
    region="region"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apigateway.*;
import software.amazon.awscdk.services.stepfunctions.tasks.*;

RestApi restApi;

CallApiGatewayRestApiEndpointOptions callApiGatewayRestApiEndpointOptions = CallApiGatewayRestApiEndpointOptions.builder()
        .api(restApi)
        .stageName("stageName")

        // the properties below are optional
        .region("region")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGateway;
using Amazon.CDK.AWS.StepFunctions.Tasks;

RestApi restApi;

var callApiGatewayRestApiEndpointOptions = new CallApiGatewayRestApiEndpointOptions {
    Api = restApi,
    StageName = "stageName",

    // the properties below are optional
    Region = "region"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var restApi RestApi

callApiGatewayRestApiEndpointOptions := &CallApiGatewayRestApiEndpointOptions{
	Api: restApi,
	StageName: jsii.String("stageName"),

	// the properties below are optional
	Region: jsii.String("region"),
}
```

## Properties

- `api`: [IRestApi](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IRestApi.html) (required) — API to call.

- `region`: string — Specify a custom Region where the API is deployed, e.g. 'us-east-1'.

  **Default:** Uses the Region of the stack containing the `api`.

- `stageName`: string (required) — Name of the stage where the API is deployed to in API Gateway.
