---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://appmetrica.yandex.com/docs/en/mobile-api/post/post-profile-attributes.md
  - https://appmetrica.yandex.com/docs/ru/mobile-api/post/post-profile-attributes.md
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.com/docs/en/llms.txt

# Profile attributes

Transmits user parameters.

Usage example: You can send user parameters to the Post API to supplement user profiles and use this data for audience-based segmentation. For example, add an attribute indicating that the user is a loyalty program member.

Event properties can be passed in parameters or in the body of the request. When you pass data in the body, you should add `.csv` to the URL of the request. For more information, see [Sample request](#sample).

To bind an event to a user, you should use one of the following fields in the API request:

- `profile_id`
- `appmetrica_device_id`

{% note alert %}

The Post API has restrictions on loading data. For more information, see [Restrictions](https://appmetrica.yandex.com/docs/en/mobile-api/post/restrictions.md).

{% endnote %}

## Request format

```
POST https://api.appmetrica.yandex.com/logs/v1/import/profiles
  ? post_api_key=<string>
  & application_id=<int>
  & profile_id=<string>
  & attributes=<>
```

#|
|| `post_api_key`* | A token for data uploading. You can get it in the **Settings** section of your application. ||
|| `application_id`* | Unique numeric identifier for the application in AppMetrica. ||
|| `profile_id`* | User profile ID. The Post API allows you only to upload data for identifiers that were previously sent via the SDK.

{% note alert %}

Do not pass the value with the `appmetrica_device_id` parameter. The server accepts only one of these parameters.

{% endnote %}

||
|| `attributes`* | A set of custom attribute values in `{key:value}` format. Possible value types: string, number, bool, or counter. If the value of the passed attribute is already written for the profile, it will be overwritten with a new one. Former attribute values will be deleted. Learn more about [User profile attributes](https://appmetrica.yandex.com/docs/en/data-collection/profile-attributes.md).

{% note alert %}

To collect custom profile attributes, add them in the app settings. To do this, open the app page, select **Settings**, and click **Profile attributes**.

{% endnote %}
||
|#

### First-party data {#fpd}

First-party data (FPD, 1PD) refers to logins, emails, phone numbers, internal identifiers such as `user_id` and `CRM_id`, and other data that allows for unambiguous user identification. This enables proper linking of user actions when they perform some actions in the service's web interface and others in the mobile app, or when using different devices (for example, a mobile app on a smartphone and a tablet).

AppMetrica does not store first-party data attribute values in plain text. Passed identifiers are saved in hashed form and are used to match user actions across devices and platforms. The user profile only contains information about which first-party data attributes were passed for that user.

Post API supports sending the following attributes:

- `appmetrica_1pd_phone_sha256_0`..`appmetrica_1pd_phone_sha256_9` — phone number hashes (no more than 10 values);
- `appmetrica_1pd_email_sha256_0`..`appmetrica_1pd_email_sha256_9` — email address hashes (no more than 10 values);
- `appmetrica_1pd_telegram_sha256` — Telegram login hash (one value).

Example of a request that sends a phone number hash:

```
POST https://api.appmetrica.yandex.com/logs/v1/import/profiles
  ? post_api_key=<string>
  & application_id=<int>
  & profile_id=<string>
  & attributes={"appmetrica_1pd_phone_sha256_0":"<string>"}
```

When sending a request with first-party data attributes, AppMetrica will automatically generate attributes with the names `appmetrica_1pd_phone_0`..`appmetrica_1pd_phone_9`, `appmetrica_1pd_email_0`..`appmetrica_1pd_email_9`, `appmetrica_1pd_telegram`.

You can verify that first-party data attributes were passed using boolean profile attributes:

- `appmetrica_1pd_phone_passed` — equals `true` if at least one valid value of the `appmetrica_1pd_phone_sha256_*` attribute was received from the user.
- `appmetrica_1pd_email_passed` — equals `true` if at least one valid value of the `appmetrica_1pd_email_sha_256_*` attribute was received from the user.
- `appmetrica_1pd_telegram_passed` — equals `true` if a valid value of the `appmetrica_1pd_telegram_sha256` attribute was received from the user.

The AppMetrica interface does not display the passed FPD, but you can verify that a first-party data attribute was passed in the [profile list](https://appmetrica.yandex.com/docs/en/mobile-reports/profile-list.md) — in segmentation parameters and in groupings by profile attributes in the **Predefined attributes** subsection.

{% cut "Segmentation in profile list" %}

![segmentation in profile list](../../../_images/profile-fpd-segment-en.png){style="border: solid 1px #cccccc; max-width: 400px;"}

{% endcut %}

{% cut "Grouping in profile list" %}

![grouping in profile list](../../../_images/profile-fpd-grouping-en.png){style="border: solid 1px #cccccc; max-width: 500px;"}

{% endcut %}

Sending first-party data attributes is also available via SDK:

- [for Android](https://appmetrica.yandex.com/docs/en/sdk/android/analytics/android-operations.md#send-attribute-profile-1pd)
- [for iOS](https://appmetrica.yandex.com/docs/en/sdk/ios/analytics/ios-operations.md#send-attribute-profile-1pd)

## Response codes {#response-codes}

| Code | Description |
| ----- | ----- |
| 200 | Data has been uploaded successfully. |
| 403 | The request omitted an authorization header, or an invalid token was specified. |
| 400 | One or more required parameters were missing in the request. |

## Sample request {#sample}

{% list tabs %}

- Sending data in the request body

  ```http translate=no
  POST /logs/v1/import/profiles.csv?post_api_key=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012 HTTP/1.1
  Host: api.appmetrica.yandex.com
  Connection: close

  application_id,profile_id,attributes
  1234567890,1234567890abcdef,"{""string_attribute_name"":""string_value"",""number_attribute_name"":1234,""bool_attribute_name"":true,""counter_attribute_name"":-1}"
  ```

  Sending first-party data:

  ```http translate=no
  POST /logs/v1/import/profiles.csv?post_api_key=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012 HTTP/1.1
  Host: api.appmetrica.yandex.com
  Connection: close
  
  application_id,profile_id,attributes
  1234567890,1234567890abcdef,"{""appmetrica_1pd_phone_sha256_0"":""phone-number-hash"",""appmetrica_1pd_email_0"":""email-hash"",""appmetrica_1pd_telegram"":""login-hash""}"
  ```

- Sending data in request parameters

  ```http translate=no
  POST /logs/v1/import/profiles?post_api_key=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012&application_id=1234567890&profile_id=1234567890abcdef&attributes={"string_attribute_name":"string_value","number_attribute_name":1234,"bool_attribute_name":true,"counter_attribute_name":-1} HTTP/1.1
  Host: api.appmetrica.yandex.com
  Content-Length: 0
  Connection: close
  ```

  Sending first-party data:

  ```http translate=no
  POST /logs/v1/import/profiles?post_api_key=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012&application_id=1234567890&profile_id=1234567890abcdef&attributes={"appmetrica_1pd_phone_sha256_0":"phone-number-hash","appmetrica_1pd_email_0":"email-hash","appmetrica_1pd_telegram":"login-hash"} HTTP/1.1
  Host: api.appmetrica.yandex.com
  Content-Length: 0
  Connection: close
  ```

{% endlist %}

You can only use the Post API to change the user's [custom](https://appmetrica.yandex.com/docs/en/data-collection/profile-attributes.md#custom) attributes. To deliver [predefined](https://appmetrica.yandex.com/docs/en/data-collection/profile-attributes.md) attributes, use the AppMetrica SDK. For more information, see [Set up sending profile attributes](https://appmetrica.yandex.com/docs/en/data-collection/about-profiles.md#profile-settings).

## Other Post API methods {#other-methods}

- [Uploading events](https://appmetrica.yandex.com/docs/en/mobile-api/post/post-import-events.md)
- [Uploading In-App Revenue events](https://appmetrica.yandex.com/docs/en/mobile-api/post/post-revenue.md)
- [Uploading Ad Revenue events](https://appmetrica.yandex.com/docs/en/mobile-api/post/post-adrevenue.md)
- [Uploading E-commerce events](https://appmetrica.yandex.com/docs/en/mobile-api/post/post-ecommerce.md)

<!-- source: en/_includes/feedback-button-2.md -->
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.

<a href="../../troubleshooting/feedback-new">
  <span class="button">Contact support</span>
</a>

<a href="../../troubleshooting/feedback-docs">
  <span class="button">Suggest an improvement for documentation</span>
</a>
<!-- endsource: en/_includes/feedback-button-2.md -->
