- [HTTP request](https://developers.google.com/health/reference/rest/v4/projects.subscribers/create#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/health/reference/rest/v4/projects.subscribers/create#body.PATH_PARAMETERS)
- [Query parameters](https://developers.google.com/health/reference/rest/v4/projects.subscribers/create#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/health/reference/rest/v4/projects.subscribers/create#body.request_body)
- [Response body](https://developers.google.com/health/reference/rest/v4/projects.subscribers/create#body.response_body)
- [Authorization scopes](https://developers.google.com/health/reference/rest/v4/projects.subscribers/create#body.aspect)
- [IAM Permissions](https://developers.google.com/health/reference/rest/v4/projects.subscribers/create#body.aspect_1)
- [Examples](https://developers.google.com/health/reference/rest/v4/projects.subscribers/create#examples)
- [Try it!](https://developers.google.com/health/reference/rest/v4/projects.subscribers/create#try-it)

Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent.

**Endpoint Verification:** For a subscriber to be successfully created, the provided `endpointUri` must be a valid HTTPS endpoint and must pass an automated verification check. The backend will send two HTTP POST requests to the `endpointUri`:

1. **Verification with Authorization:**

   - **Headers:** Includes `Content-Type: application/json` and `Authorization` (with the exact value from `CreateSubscriberPayload.endpoint_authorization.secret`).
   - **Body:** `{"type": "verification"}`
   - **Expected Response:** HTTP `201 Created`.
2. **Verification without Authorization:**

   - **Headers:** Includes `Content-Type: application/json`. The `Authorization` header is OMITTED.
   - **Body:** `{"type": "verification"}`
   - **Expected Response:** HTTP `401 Unauthorized` or `403 Forbidden`.

Both tests must pass for the subscriber creation to succeed. If verification fails, the operation will not be completed and an error will be returned. This process ensures the endpoint is reachable and correctly validates the `Authorization` header.

### HTTP request

`POST https://health.googleapis.com/v4/{parent=projects/*}/subscribers`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax. To know more about valid error responses that can be thrown by this HTTP request, please refer to the [service error catalog](https://developers.google.com/health/reference/rest/v4/errors)

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The parent resource where this subscriber will be created. Format: projects/{project_number} Example: projects/1234567890 It takes the form `projects/{project}`. |

### Query parameters

| Parameters ||
|---|---|
| `subscriberId` | `string` Optional. The ID to use for the subscriber, which will become the final component of the subscriber's resource name. This value should be 4-36 characters, and valid characters are /[a-z](https://developers.google.com/health/reference/rest/v4/projects.subscribers/[a-z0-9-]{2,34}[a-z0-9])/. |

### Request body

The request body contains an instance of `https://developers.google.com/health/reference/rest/v4/projects.subscribers#CreateSubscriberPayload`.

### Response body

If successful, the response body contains a newly created instance of `https://developers.google.com/health/reference/rest/Shared.Types/Operation`.

### Authorization scopes

Requires the following OAuth scope:

- `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:

- `health.subscribers.create`

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