---
title: "Grant access level"
method: POST
path: "/api/v2/server-side-api/purchase/profile/grant/access-level/"
tags: ["Purchase"]
---

# Grant access level

`POST /api/v2/server-side-api/purchase/profile/grant/access-level/`

Provides access level to your end-user without providing info on the transaction. This comes in handy if you have bonuses for referrals or other events related to your products. The access level provided by this method will not be reflected in your analytics. It will be sent to only webhook integration, and only in this case will appear in the Event Feed.

## Headers

- `adapty-customer-user-id` string
- `adapty-profile-id` string

## Request body

- GrantAccessRequest
  - `access_level_id` string, required — Paid access level ID configured in the Access Levels page
  - `starts_at` string, date-time, nullable — The datetime when the access level will be active. Maybe in the future. The default value is null.
  - `expires_at` string, date-time, nullable — The datetime when the access level will expire. It may be in the past and may be null for lifetime access. The default value is null.

## Response `200`

Access level granted successfully

- ProfileResponse
  - `data` Profile, required
    - `app_id` string, uuid, required — The internal ID of your app
    - `profile_id` string, uuid, required — Adapty profile ID
    - `customer_user_id` string, nullable, required — The ID of your user in your system
    - `total_revenue_usd` number, float, required — A float value representing the total revenue in USD earned in the profile
    - `segment_hash` string, required — Internal parameter
    - `timestamp` integer, required — Response time in milliseconds, needs for resolve a race condition
    - `custom_attributes` CustomAttribute[], required — A maximum of 30 custom attributes to the profile are allowed to be set
      - `key` string, required — The key must be a string with no more than 30 characters. Only letters, numbers, dashes, points, and underscores allowed
      - `value` union, required — The attribute value must be no more than 50 characters. Only strings and floats are allowed as values
        - string
        - number
    - `access_levels` AccessLevel[], required — Array of Access level objects. Empty array if the customer has no access levels
      - `access_level_id` string — Access level identifier
      - `store` string — Store where the access level was purchased
      - `store_product_id` string — Product ID in the store
      - `store_base_plan_id` string, nullable — Base plan ID in the store
      - `store_transaction_id` string — Transaction ID in the store
      - `store_original_transaction_id` string — Original transaction ID in the store
      - `offer` OfferDTO
        - `category` 'introductory' | 'promotional' | 'offer_code' | 'win_back', required — Offer category
        - `type` 'free_trial' | 'pay_as_you_go' | 'pay_up_front', required — Offer type
        - `id` string, nullable — Offer ID
      - `starts_at` string, date-time, nullable — When the access level starts
      - `purchased_at` string, date-time — When the access level was purchased
      - `originally_purchased_at` string, date-time — When the access level was originally purchased
      - `expires_at` string, date-time, nullable — When the access level expires
      - `renewal_cancelled_at` string, date-time, nullable — When renewal was cancelled
      - `billing_issue_detected_at` string, date-time, nullable — When billing issue was detected
      - `is_in_grace_period` boolean — Whether the access level is in grace period
      - `cancellation_reason` string, nullable — Reason for cancellation
    - `subscriptions` Subscription[], required — Array of Subscription objects. Empty array if the customer has no subscriptions
      - `store` string — Store where the subscription was purchased
      - `store_product_id` string — Product ID in the store
      - `store_base_plan_id` string, nullable — Base plan ID in the store
      - `store_transaction_id` string — Transaction ID in the store
      - `store_original_transaction_id` string — Original transaction ID in the store
      - `offer` OfferDTO
        - `category` 'introductory' | 'promotional' | 'offer_code' | 'win_back', required — Offer category
        - `type` 'free_trial' | 'pay_as_you_go' | 'pay_up_front', required — Offer type
        - `id` string, nullable — Offer ID
      - `environment` string — Environment (Sandbox, Production)
      - `purchased_at` string, date-time — When the subscription was purchased
      - `originally_purchased_at` string, date-time — When the subscription was originally purchased
      - `expires_at` string, date-time, nullable — When the subscription expires
      - `renewal_cancelled_at` string, date-time, nullable — When renewal was cancelled
      - `billing_issue_detected_at` string, date-time, nullable — When billing issue was detected
      - `is_in_grace_period` boolean — Whether the subscription is in grace period
      - `cancellation_reason` string, nullable — Reason for cancellation
    - `non_subscriptions` NonSubscription[], required — Array of Non-Subscription objects. Empty array if the customer has no purchases
      - `purchase_id` string, uuid — Unique purchase identifier
      - `store` string — Store where the purchase was made
      - `store_product_id` string — Product ID in the store
      - `store_base_plan_id` string, nullable — Base plan ID in the store
      - `store_transaction_id` string — Transaction ID in the store
      - `store_original_transaction_id` string — Original transaction ID in the store
      - `purchased_at` string, date-time — When the purchase was made
      - `environment` string — Environment (Sandbox, Production)
      - `is_refund` boolean — Whether this is a refund
      - `is_consumable` boolean — Whether this is a consumable purchase

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Profile not found
- `500` — Internal server error

---

[API](https://skmtc.dev/adapty/apis/adapty-server-side-api.md) · [All operations](https://skmtc.dev/adapty/apis/adapty-server-side-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/adapty/adapty-server-side-api/revisions/abdc1c773a17/schema)
