openapi: 3.0.3 info: title: Adapty Server-Side Access Levels Profiles API description: 'Representative OpenAPI description of the Adapty Server-Side REST API (v2). Adapty''s core product is a mobile client SDK for paywalls, A/B testing, remote config, and receipt validation; this Server-Side API is the supporting REST surface for programmatically managing profiles, purchases and transactions, access levels (entitlements), and paywalls. Authenticate with a secret API key using the `Authorization: Api-Key ` header, and address a profile with either the `adapty-profile-id` or `adapty-customer-user-id` request header. Endpoint paths are faithful to Adapty''s published Server-Side API v2 reference; request/response bodies are representative.' termsOfService: https://adapty.io/terms/ contact: name: Adapty Support url: https://adapty.io/contacts/ email: support@adapty.io version: '2.0' servers: - url: https://api.adapty.io/api/v2/server-side-api description: Adapty Server-Side API v2 security: - ApiKeyAuth: [] tags: - name: Profiles description: Get, create, update, and delete end-user profiles. paths: /profile/: get: operationId: getProfile tags: - Profiles summary: Get profile description: Retrieve the end-user's profile including access levels, subscriptions, and non-subscriptions. Identify the profile with the `adapty-profile-id` or `adapty-customer-user-id` request header. parameters: - $ref: '#/components/parameters/ProfileIdHeader' - $ref: '#/components/parameters/CustomerUserIdHeader' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ProfileResponse' post: operationId: createProfile tags: - Profiles summary: Create profile description: Create a new end-user profile in Adapty. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateProfileRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ProfileResponse' patch: operationId: updateProfile tags: - Profiles summary: Update profile description: Update attributes on an existing end-user profile. parameters: - $ref: '#/components/parameters/ProfileIdHeader' - $ref: '#/components/parameters/CustomerUserIdHeader' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateProfileRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ProfileResponse' delete: operationId: deleteProfile tags: - Profiles summary: Delete profile description: Delete an end-user profile and its associated data. parameters: - $ref: '#/components/parameters/ProfileIdHeader' - $ref: '#/components/parameters/CustomerUserIdHeader' responses: '204': description: No Content components: schemas: Subscription: type: object properties: is_active: type: boolean vendor_product_id: type: string store: type: string expires_at: type: string format: date-time nullable: true renewed_at: type: string format: date-time nullable: true is_in_grace_period: type: boolean is_sandbox: type: boolean CreateProfileRequest: type: object properties: customer_user_id: type: string email: type: string format: email custom_attributes: type: object additionalProperties: true AccessLevel: type: object properties: id: type: string example: premium is_active: type: boolean is_lifetime: type: boolean expires_at: type: string format: date-time nullable: true activated_at: type: string format: date-time store: type: string example: app_store vendor_product_id: type: string will_renew: type: boolean ProfileResponse: type: object properties: data: $ref: '#/components/schemas/Profile' UpdateProfileRequest: type: object properties: email: type: string format: email phone_number: type: string custom_attributes: type: object additionalProperties: true Profile: type: object properties: profile_id: type: string format: uuid customer_user_id: type: string nullable: true segment_hash: type: string access_levels: type: object additionalProperties: $ref: '#/components/schemas/AccessLevel' subscriptions: type: object additionalProperties: $ref: '#/components/schemas/Subscription' non_subscriptions: type: object additionalProperties: type: array items: $ref: '#/components/schemas/NonSubscription' custom_attributes: type: object additionalProperties: true NonSubscription: type: object properties: purchase_id: type: string vendor_product_id: type: string store: type: string purchased_at: type: string format: date-time is_consumable: type: boolean is_refund: type: boolean parameters: ProfileIdHeader: name: adapty-profile-id in: header required: false description: The user's Adapty profile ID. schema: type: string format: uuid CustomerUserIdHeader: name: adapty-customer-user-id in: header required: false description: The user's ID in your own system. schema: type: string securitySchemes: ApiKeyAuth: type: apiKey in: header name: Authorization description: 'Secret API key passed as `Authorization: Api-Key `. Find your secret key in the Adapty dashboard under App Settings > API keys.'