# diagrid call publish

Publish a message to a pub/sub topic

### Description

Publish a message to a topic on an existing pub/sub component via the Dapr Pub/Sub API.

```
diagrid call publish <topic> [flags]
```

### Examples

```

  #  Publish a message onto a specific topic using a pubsub component
  diagrid call publish my-topic --component my-pubsub --id publisher --data '{"orderId": 1}'

```

### Options

```
  -a, --id string          Publisher id
  -c, --component string   Component name for target pub/sub broker
  -p, --project string     Name of existing project
  -d, --data string        Data string
  -o, --output string      Output format, supported [table, yaml, json] (default "table")
      --verbose            Include verbose output such as curl command and response body
  -h, --help               help for publish
```

### Options inherited from parent commands

```
      --api-key string   Diagrid Cloud API key
```

### SEE ALSO

- [diagrid call](./call.md)	 - Invoke Catalyst APIs directly
