

# sam remote callback
<a name="sam-cli-command-reference-sam-remote-callback"></a>

This page provides reference information for the AWS Serverless Application Model Command Line Interface (AWS SAM CLI) `sam remote callback` command.

For an introduction to the AWS SAM CLI, see [What is the AWS SAM CLI?](what-is-sam-overview.md#what-is-sam-cli)

The `sam remote callback` command allows you to send callbacks to remote durable function executions running in AWS Lambda.

**Note**  
These commands require access to AWS credentials.

## Usage
<a name="sam-cli-command-reference-sam-remote-callback-usage"></a>

```
$ sam remote callback <subcommand> <options>
```

## Options
<a name="sam-cli-command-reference-sam-remote-callback-options"></a>

`--help, -h`  <a name="sam-cli-command-reference-sam-remote-callback-options-help"></a>
Show this message and exit.

## Subcommands
<a name="sam-cli-command-reference-sam-remote-callback-subcommands"></a>

`succeed`  <a name="sam-cli-command-reference-sam-remote-callback-subcommands-succeed"></a>
Send a callback success to a remote durable function execution. For more information, see [sam remote callback succeed](sam-cli-command-reference-sam-remote-callback-succeed.md).

`fail`  <a name="sam-cli-command-reference-sam-remote-callback-subcommands-fail"></a>
Send a callback failure to a remote durable function execution. For more information, see [sam remote callback fail](sam-cli-command-reference-sam-remote-callback-fail.md).

`heartbeat`  <a name="sam-cli-command-reference-sam-remote-callback-subcommands-heartbeat"></a>
Send a callback heartbeat to a remote durable function execution. For more information, see [sam remote callback heartbeat](sam-cli-command-reference-sam-remote-callback-heartbeat.md).

# sam remote callback succeed
<a name="sam-cli-command-reference-sam-remote-callback-succeed"></a>

Send a callback success to a remote durable function execution.

**Note**  
This command requires access to AWS credentials.

## Usage
<a name="ref-sam-cli-remote-callback-succeed-usage"></a>

```
$ sam remote callback succeed CALLBACK_ID [OPTIONS]
```

## Required Arguments
<a name="ref-sam-cli-remote-callback-succeed-arguments"></a>

`CALLBACK_ID`  
The unique identifier of the callback to send a success response to.

## Options
<a name="ref-sam-cli-remote-callback-succeed-options"></a>

`-r, --result TEXT`  
Success result payload as string.

`--region TEXT`  
Set the AWS Region of the service (for example, `us-east-1`).

`--profile TEXT`  
Select a specific profile from your credential file to get AWS credentials.

`--config-env TEXT`  
Environment name specifying default parameter values in the configuration file. Default: `default`

`--config-file TEXT`  
Configuration file containing default parameter values. Default: `samconfig.toml`

`--save-params`  
Save the parameters provided via the command line to the configuration file.

`--beta-features / --no-beta-features`  
Enable/Disable beta features.

`--debug`  
Turn on debug logging to print debug messages generated by AWS SAM CLI and display timestamps.

`-h, --help`  
Shows this message and exits.

## Examples
<a name="ref-sam-cli-remote-callback-succeed-examples"></a>

Send success callback with no result:

```
$ sam remote callback succeed my-callback-id
```

Send success callback with result:

```
$ sam remote callback succeed my-callback-id --result 'Task completed successfully'
```

# sam remote callback fail
<a name="sam-cli-command-reference-sam-remote-callback-fail"></a>

Send a callback failure to a remote durable function execution.

**Note**  
This command requires access to AWS credentials.

## Usage
<a name="ref-sam-cli-remote-callback-fail-usage"></a>

```
$ sam remote callback fail CALLBACK_ID [OPTIONS]
```

## Required Arguments
<a name="ref-sam-cli-remote-callback-fail-arguments"></a>

`CALLBACK_ID`  
The unique identifier of the callback to send a failure response to.

## Options
<a name="ref-sam-cli-remote-callback-fail-options"></a>

`--error-data TEXT`  
Additional error data.

`--stack-trace TEXT`  
Stack trace entries. This option can be specified multiple times.

`--error-type TEXT`  
Type of error.

`--error-message TEXT`  
Detailed error message.

`--region TEXT`  
Set the AWS Region of the service (for example, `us-east-1`).

`--profile TEXT`  
Select a specific profile from your credential file to get AWS credentials.

`--config-env TEXT`  
Environment name specifying default parameter values in the configuration file. Default: `default`

`--config-file TEXT`  
Configuration file containing default parameter values. Default: `samconfig.toml`

`--save-params`  
Save the parameters provided via the command line to the configuration file.

`--beta-features / --no-beta-features`  
Enable/Disable beta features.

`--debug`  
Turn on debug logging to print debug messages generated by AWS SAM CLI and display timestamps.

`-h, --help`  
Shows this message and exits.

## Examples
<a name="ref-sam-cli-remote-callback-fail-examples"></a>

Send failure callback with no parameters:

```
$ sam remote callback fail my-callback-id
```

Send failure callback with error message:

```
$ sam remote callback fail my-callback-id --error-message 'Task failed'
```

Send failure callback with all parameters:

```
$ sam remote callback fail my-callback-id --error-message 'Task failed' --error-type 'ValidationError' --stack-trace 'at line 42' --error-data '{"code": 500}'
```

# sam remote callback heartbeat
<a name="sam-cli-command-reference-sam-remote-callback-heartbeat"></a>

Send a callback heartbeat to a remote durable function execution.

**Note**  
This command requires access to AWS credentials.

## Usage
<a name="ref-sam-cli-remote-callback-heartbeat-usage"></a>

```
$ sam remote callback heartbeat CALLBACK_ID [OPTIONS]
```

## Required Arguments
<a name="ref-sam-cli-remote-callback-heartbeat-arguments"></a>

`CALLBACK_ID`  
The unique identifier of the callback to send a heartbeat to.

## Options
<a name="ref-sam-cli-remote-callback-heartbeat-options"></a>

`--region TEXT`  
Set the AWS Region of the service (for example, `us-east-1`).

`--profile TEXT`  
Select a specific profile from your credential file to get AWS credentials.

`--config-env TEXT`  
Environment name specifying default parameter values in the configuration file. Default: `default`

`--config-file TEXT`  
Configuration file containing default parameter values. Default: `samconfig.toml`

`--save-params`  
Save the parameters provided via the command line to the configuration file.

`--beta-features / --no-beta-features`  
Enable/Disable beta features.

`--debug`  
Turn on debug logging to print debug messages generated by AWS SAM CLI and display timestamps.

`-h, --help`  
Shows this message and exits.

## Examples
<a name="ref-sam-cli-remote-callback-heartbeat-examples"></a>

Send heartbeat callback:

```
$ sam remote callback heartbeat my-callback-id
```