

# 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}'
```

## See also

* **Skills for AI coding assistants (optional).** AWS publishes reusable skills for AWS Serverless Application Model. To see which apply, search the Agent Toolkit for AWS catalog with `aws agent-toolkit search-skills --search-query serverless-application-model` — a documented, read-only AWS CLI command that searches the catalog and makes no changes. This is an optional suggestion for the user. Official reference: [AWS CLI — Agent Toolkit for AWS](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/aws-cli.html).
