- [HTTP request](https://docs.cloud.google.com/eventarc/docs/reference/publishing/rest/v1/projects.locations.channelConnections/publishEvents#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/eventarc/docs/reference/publishing/rest/v1/projects.locations.channelConnections/publishEvents#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/eventarc/docs/reference/publishing/rest/v1/projects.locations.channelConnections/publishEvents#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/eventarc/docs/reference/publishing/rest/v1/projects.locations.channelConnections/publishEvents#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/eventarc/docs/reference/publishing/rest/v1/projects.locations.channelConnections/publishEvents#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/eventarc/docs/reference/publishing/rest/v1/projects.locations.channelConnections/publishEvents#body.aspect)
- [Try it!](https://docs.cloud.google.com/eventarc/docs/reference/publishing/rest/v1/projects.locations.channelConnections/publishEvents#try-it)

Publishes events to a ChannelConnection in a partner's project.

### HTTP request

Choose an endpoint:
global asia-south1 asia-southeast1 australia-southeast1 europe-north1 europe-west1 europe-west3 us-central1 us-east4   
`POST https://eventarcpublishing.googleapis.com/v1/{channelConnection=projects/*/locations/*/channelConnections/*}:publishEvents`

<br />

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `channelConnection` | `string` The channelConnection that the events are published from. For example: `projects/{partner_project_id}/locations/{location}/channelConnections/{channelConnectionId}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "events": [ { "@type": string, field1: ..., ... } ], "textEvents": [ string ] } ``` |

| Fields ||
|---|---|
| `events[]` | `object` The CloudEvents v1.0 events to publish. No other types are allowed. If this field is set, then the `textEvents` fields must not be set. An object containing fields of an arbitrary type. An additional field `"@type"` contains a URI identifying the type. Example: `{ "id": 1234, "@type": "types.example.com/standard/id" }`. |
| `textEvents[]` | `string` The text representation of events to publish. CloudEvent v1.0 in JSON format is the only allowed type. Refer to <https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md> for specification. If this field is set, then the `events` fields must not be set. |

### Response body

If successful, the response body is empty.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).