> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corrily.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Identify Call

> Link IPs to users and update user features.

The identify endpoint serves three purposes:

1. It can be used to pass user-level features after (or before) a price has already been tied to them using the [main price endpoint](api-reference/calculate-price).
2. It can be used to link IPs to user\_ids so that prices persist to a user as they see a price -> login in -> check the price again.
3. It is used during mobile integrations to inform Corrily about original [Apple](/integrations/02_apple-iap-integration) and [Google](/integrations/03_google-iap-integration) purchase IDs.

## Body Params

<ParamField body="user_id" type="string" required>
  A [User ID](../users/01_users).
</ParamField>

<ParamField body="ip" type="string">
  An IP you wish to tie the user to. For more information read our [anonymous users guide](../users/03_handling-anonymous-users).
</ParamField>

<ParamField body="country" type="string">
  Optional field which indicates the country which the user belongs to. If the country given is not part of the experiment for the ip user, the user id given
  wont be added to the experiment via identify. Please note this country wont be stored against user. This is used only for validating
  if the experiment characteristics for previous user from the ip can be applied to the user id.
  The user country will be locked to the country given in subsequent price call.
</ParamField>

<ParamField body="features" type="object">
  An object containing arbitrary key-value pairs that represent characteristics
  of this user which may affect their optimal price. The keys can be any valid
  JSON key. The values can be strings, integers, or floats.
</ParamField>

<ParamField body="apple_original_transaction_id" type="object">
  Pass an `original_transaction_id` for a user when they purchase an IAP product. (Note that in the backend, this will not overwrite any previously stored transaction IDs for this user).
</ParamField>

<ParamField body="google_purchase_token" type="object">
  Pass an `purchaseToken` for a user when they purchase an in-app product. (Note that in the backend, this will not overwrite any previously stored purchase tokens for this user).
</ParamField>

## Response

<ResponseField name="status" type="string" />

<ResponseField name="variants_overwritten" type="string">
  Its an optional field. If the identify call copied experiment attributes from ip to the user, this attribute will be included in the response. Otherwise, it wont be included in the response.
</ResponseField>

<RequestExample>
  ```bash Bash theme={null}
  curl --request POST \
       --url https://client.corrily.com/v1/identify \
       --header 'Accept: application/json' \
       --header 'Content-Type: application/json' \
       --data '{ user_id: "string", features: {source: "youtube"} }'
  ```

  ```js Node theme={null}
  const fetch = require("node-fetch");

  const url = "https://client.corrily.com/v1/identify";
  const options = {
    method: "POST",
    headers: { Accept: "application/json", "Content-Type": "application/json" },
    body: JSON.stringify({ user_id: "test_user", features: {"source": "youtube"} }),
  };

  fetch(url, options)
    .then((res) => res.json())
    .then((json) => console.log(json))
    .catch((err) => console.error("error:" + err));
  ```

  ```python Python theme={null}
  import requests

  url = "https://client.corrily.com/v1/identify"

  payload = { "user_id": "test_user", "features": {"source": "youtube"} }
  headers = {
      "Accept": "application/json",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.text)
  ```
</RequestExample>

<ResponseExample>
  ```json Example theme={null}
  {
    "status": "ok"
  }
  ```
</ResponseExample>
