**Example 1: To invoke a Lambda function synchronously** The following ``invoke`` example invokes the ``my-function`` function synchronously. The ``cli-binary-format`` option is required if you're using AWS CLI version 2. For more information, see `AWS CLI supported global command line options `__ in the *AWS Command Line Interface User Guide*.:: aws lambda invoke \ --function-name my-function \ --cli-binary-format raw-in-base64-out \ --payload '{ "name": "Bob" }' \ response.json Output:: { "ExecutedVersion": "$LATEST", "StatusCode": 200 } For more information, see `Synchronous Invocation `__ in the *AWS Lambda Developer Guide*. **Example 2: To invoke a Lambda function asynchronously** The following ``invoke`` example invokes the ``my-function`` function asynchronously. The ``cli-binary-format`` option is required if you're using AWS CLI version 2. For more information, see `AWS CLI supported global command line options `__ in the *AWS Command Line Interface User Guide*.:: aws lambda invoke \ --function-name my-function \ --invocation-type Event \ --cli-binary-format raw-in-base64-out \ --payload '{ "name": "Bob" }' \ response.json Output:: { "StatusCode": 202 } For more information, see `Asynchronous Invocation `__ in the *AWS Lambda Developer Guide*.