Command

nylas webhook test payload

Generate a sample webhook payload.

Written by Qasim Muhammad Staff SRE

What does nylas webhook test payload do?

The nylas webhook test payload command prints a deterministic sample webhook payload for a trigger type such as message.created or event.created. Use it to create fixtures for local tests, CI replay, and parser validation before production events arrive.

Usage

nylas webhook test payload [trigger-type] [--json]

Flags

FlagDescription
--jsonOutput as JSON
--no-colorDisable color output
--verbose(-v)Enable verbose output
--configCustom config file path
--help(-h)Show help for the command
--limitLimit results (most list commands)
--yes(-y)Skip confirmations
--triggerTrigger type to generate when not passed positionally
--jsonOutput as JSON

Examples

Generate a message.created payload

nylas webhook test payload message.created --json

Save a fixture

nylas webhook test payload event.created --json > event.created.json

Example output

{
  "type": "message.created",
  "data": {
    "object": {
      "id": "message_abc123",
      "grant_id": "grant_abc123",
      "subject": "Welcome"
    }
  }
}

Troubleshooting

Unknown trigger type

Run nylas webhook triggers to list supported trigger types, then pass one of those values positionally or with --trigger.

Recommended guides

Run nylas webhook test payload --help for full help output.