---
title: "POST /v4/projects/{projectsId}/subscribers/{subscribersId}/subscriptions"
method: POST
path: "/v4/projects/{projectsId}/subscribers/{subscribersId}/subscriptions"
tags: ["projects"]
---

# POST /v4/projects/{projectsId}/subscribers/{subscribersId}/subscriptions

`POST /v4/projects/{projectsId}/subscribers/{subscribersId}/subscriptions`

## Request

- Base URL: `https://health.googleapis.com`
- URL: `https://health.googleapis.com/v4/projects/{projectsId}/subscribers/{subscribersId}/subscriptions`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Creates a subscription for a specific user to a specific subscriber. This method requires the subscriber to have a `SubscriptionCreatePolicy` set to `MANUAL` for the given data types.

## Path parameters

- `projectsId` string, required
- `subscribersId` string, required

## Query parameters

- `subscriptionId` string

## Request body

- CreateSubscriptionPayload: Payload for creating a subscription.
  - `dataTypes` string[]: Optional. Data types subscribed to.
  - `user` string: Required. Immutable. The resource name of the user for whom this subscription is active. Format: `users/{user}` where `{user}` is the public `healthUserId` as returned by the `GetIdentity` action in the profile PAPI (see `google.devicesandservices.health.v4main.HealthProfileService.GetIdentity`).

## Response `200`

Successful response

- Subscription: A subscription to a data collection for a specific user, to be delivered to a subscriber.
  - `dataTypes` string[]: Optional. Data types subscribed to. A subscriber will only receive notifications for data types that are declared here. A subscription can only subscribe to the data types of the subscriber. The values should be in the format "users/{health_user_id}/dataTypes/{data_type}" where `{data_type}` is one of "altitude", "distance", "floors", "sleep", "steps", "weight".
  - `name` string: Identifier. The resource name of the Subscription. Format: `projects/{project}/subscribers/{subscriber}/subscriptions/{subscription}` Example: `projects/my-project/subscribers/my-subscriber-123/subscriptions/my-subscription-456` The {project} ID is mandatory (6-30 characters, matching /a-z{6,30}/) The {subscriber} ID is user-settable (4-36 characters, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) if provided during creation, or system-generated otherwise. The {subscription} ID is user-settable (4-36 chars, matching /[a-z]([a-z0-9-]{2,34}[a-z0-9])/) or system-generated otherwise.
  - `user` string: Immutable. The resource name of the user for whom this subscription is active. Format: `users/{user}` where `{user}` is the public `healthUserId` as returned by the `GetIdentity` action in the profile PAPI (see `google.devicesandservices.health.v4main.HealthProfileService.GetIdentity`).

---

[API](https://skmtc.dev/google/apis/health.md) - [All operations](https://skmtc.dev/google/apis/health/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/health/revisions/e0bfc8d98a6f?raw)
