- [HTTP request](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send#body.HTTP_TEMPLATE)
- [Path parameters](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send#body.PATH_PARAMETERS)
- [Request body](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send#body.request_body)
  - [JSON representation](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send#body.response_body)
- [Authorization scopes](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send#body.aspect)
- [IAM Permissions](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send#body.aspect_1)
- [Try it!](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send#try-it)

Send a message to specified target (a [Firebase Installation ID (FID)](https://firebase.google.com/docs/cloud-messaging/android/get-started#access-firebase-installation-id), registration token, topic, or condition).

If duplicate fields or parameters are provided in a request (such as repeated JSON keys in the request body or duplicate query parameters), the last occurrence takes precedence.

### HTTP request

`POST https://fcm.googleapis.com/v1/{parent=projects/*}/messages:send`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. It contains the Firebase project id (i.e. the unique identifier for your Firebase project), in the format of `projects/{project_id}`. The numeric project number with no padding is also supported in the format of `projects/{project_number}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "validate_only": boolean, "message": { object (`https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#Message`) } } ``` |

| Fields ||
|---|---|
| `validate_only` | `boolean` Flag for testing the request without actually delivering the message. |
| `message` | ``object (`https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#Message`)`` Required. Message to send. |

### Response body

If successful, the response body contains an instance of `https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#Message`.

### Authorization scopes

Requires one of the following OAuth scopes:

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

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `cloudmessaging.messages.create`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).