Skip to main content

Get profile with server-side API

Retrieves the details of an existing end user of your app.

Method and endpoint

GET https://api.adapty.io/api/v2/server-side-api/profile/

Example request

curl --location 'https://api.adapty.io/api/v2/server-side-api/profile/' \
--header 'adapty-customer-user-id: <YOUR_CUSTOMER_USER_ID>' \
--header 'adapty-platform: iOS' \
--header 'Content-Type: application/json' \
--header 'adapty-profile-id: <YOUR_USER_PROFILE_ID>' \
--header 'Authorization: Api-Key <YOUR_SECRET_API_KEY>'

Placeholders:

  • <YOUR_CUSTOMER_USER_ID>: The unique ID of the customer in your system.
  • <YOUR_USER_PROFILE_ID>: The unique profile ID of the user in Adapty. `
  • <YOUR_SECRET_API_KEY>: Your secret API key for authorization.

Parameters

No parameters

Successful response: 200 - Success

Profile object

Successful response example

{
"data": {
"app_id": "14c3d333-2f3a-455a-aa86-ef83dff6913b",
"profile_id": "d8533a10-bcce-4e33-8c9d-88b05ac56559",
"customer_user_id": "77B14FB4-FD2A-4D38-AA3A-4C433F79863C",
"total_revenue_usd": 9.99,
"segment_hash": "fdaeef7f8aaa33c9",
"timestamp": 1733324566777,
"custom_attributes": [
{
"key": "favourite_sport",
"value": "yoga"
}
],
"access_levels": [
{
"access_level_id": "premium",
"store": "app_store",
"store_product_id": "unlimited.9999",
"store_base_plan_id": null,
"store_transaction_id": "2000000335013007",
"store_original_transaction_id": "2000000335013007",
"offer": null,
"starts_at": null,
"purchased_at": "2024-12-24T10:50:23+00:00",
"originally_purchased_at": "2024-12-24T10:50:23+00:00",
"expires_at": null,
"renewal_cancelled_at": "2025-01-05T13:27:47.461425+00:00",
"billing_issue_detected_at": null,
"is_in_grace_period": false,
"cancellation_reason": null
}
],
"subscriptions": [
{
"store": "app_store",
"store_product_id": "unlimited.9999",
"store_base_plan_id": null,
"store_transaction_id": "2000000815013007",
"store_original_transaction_id": "2000000815013007",
"offer": null,
"environment": "Sandbox",
"purchased_at": "2024-12-24T10:50:23+00:00",
"originally_purchased_at": "2024-12-24T10:50:23+00:00",
"expires_at": null,
"renewal_cancelled_at": null,
"billing_issue_detected_at": null,
"is_in_grace_period": false,
"cancellation_reason": null
},
{
"store": "app_store",
"store_product_id": "weekly.premium.599",
"store_base_plan_id": null,
"store_transaction_id": "2000000825768152",
"store_original_transaction_id": "2000000815033245",
"offer": null,
"environment": "Sandbox",
"purchased_at": "2024-12-24T11:13:04+00:00",
"originally_purchased_at": "2024-12-24T11:13:04+00:00",
"expires_at": "2025-01-10T11:34:40+00:00",
"renewal_cancelled_at": null,
"billing_issue_detected_at": null,
"is_in_grace_period": false,
"cancellation_reason": null
}
],
"non_subscriptions": [
{
"purchase_id": "7a5f9a7d-e236-33e6-96d8-53a3c59c5562",
"store": "app_store",
"store_product_id": "1year.premium",
"store_base_plan_id": null,
"store_transaction_id": "30002109551456",
"store_original_transaction_id": "30002109551456",
"purchased_at": "2022-10-12T09:42:50+00:00",
"environment": "Production",
"is_refund": false,
"is_consumable": false
}
]
}
}

Errors

401 - Unauthorized

The request failed due to missing or incorrect authorization. Check the Authorization page, paying close attention to the Authorization header.

The request also failed because the specified profile wasn’t found.

Body:
ParameterTypeDescription
errorsObject
  • source: (string) Always non_field_errors
  • errors: A description of the error.
error_codeStringShort error name. Always not_authenticated.
status_codeIntegerHTTP status. Always 401.
Response example:
{
"errors": [
{
"source": "non_field_errors",
"errors": [
"Authentication credentials were not provided."
]
}
],
"error_code": "not_authenticated",
"status_code": 401
}

404 - Not found

The request failed because the specified profile wasn’t found.

Body
ParameterTypeDescription
errorsObject
  • source: (string) Always non_field_errors
  • errors: A description of the error.
error_codeStringShort error name. Always not_found.
status_codeIntegerHTTP status. Always 404.
Response example
{
"errors": [
{
"source": "non_field_errors",
"errors": [
"Not found."
]
}
],
"error_code": "not_found",
"status_code": 404
}

See also: