info:
  title: Developer API
  version: 2.0.0
security:
  - BearerAuth: []
servers:
  - url: https://api.revenuecat.com/v2
openapi: 3.0.3
tags:
  - name: Customer
    description: Operations about customers.
paths:
  /projects/{project_id}/customers:
    get:
      summary: List or search customers
      operationId: list-customers
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: starting_after
          in: query
          required: false
          description: >-
            Pagination cursor. Pass the id of the last item from the previous
            page to fetch the next page; omit for the first page.
          schema:
            type: string
            example: ent12354
        - name: limit
          in: query
          required: false
          description: >-
            Maximum number of items to return per page. Values below 1 or above
            100 are clamped to that range rather than rejected.
          schema:
            type: integer
            example: 10
            default: 20
        - name: search
          description: >-
            Search term used to find matching customers within the project. The
            term is matched against, in order: the $email attribute (exact
            match), the customer's app user IDs, store transaction identifiers
            (Apple, Google Play and Amazon), and Apple order IDs. Email searches
            are paginated; all other identifier searches return a single page of
            matches.
          required: false
          in: query
          schema:
            type: string
            minLength: 1
            maxLength: 255
            example: example@example.com
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCustomers'
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
      description: >-
        This endpoint requires the following permission(s):
        <code>customer_information:customers:read</code>. This endpoint belongs
        to the <strong>Customer Information</strong> domain, which has a default
        rate limit of <strong>480 requests per minute</strong>.
    post:
      summary: Create a customer
      operationId: create-customer
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read_write
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - id
              properties:
                id:
                  description: The ID of the customer
                  type: string
                  minLength: 1
                  maxLength: 1500
                  pattern: ^[0-9a-zA-Z_-]*$
                  example: 19b8de26-77c1-49f1-aa18-019a391603e2
                attributes:
                  type: array
                  maxLength: 50
                  items:
                    type: object
                    additionalProperties: false
                    required:
                      - name
                      - value
                    properties:
                      name:
                        description: The name of the attribute
                        nullable: false
                        minLength: 1
                        maxLength: 40
                        oneOf:
                          - $ref: '#/components/schemas/CustomerAttributeReservedName'
                          - $ref: '#/components/schemas/CustomerAttributeCustomName'
                        example: $email
                      value:
                        description: The value of the attribute
                        type: string
                        maxLength: 500
                        nullable: false
                        example: cat@revenuecat.com
              additionalProperties: false
      responses:
        '201':
          description: Success. The customer was created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
      description: >-
        This endpoint requires the following permission(s):
        <code>customer_information:customers:read_write</code>. This endpoint
        belongs to the <strong>Customer Information</strong> domain, which has a
        default rate limit of <strong>480 requests per minute</strong>.
  /projects/{project_id}/customers/{customer_id}:
    get:
      summary: Get a customer
      operationId: get-customer
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read
      x-expandable-fields:
        - attributes: customer_information:customers:read
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1500
            example: 19b8de26-77c1-49f1-aa18-019a391603e2
        - name: expand
          in: query
          description: |-
            Specifies which fields in the response should be expanded.
             Accepted values are: `attributes` (requires `customer_information:customers:read` permission).
          required: false
          schema:
            type: array
            items:
              maxLength: 5000
              minLength: 1
              type: string
              enum:
                - attributes
              example: attributes
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
      description: >-
        This endpoint requires the following permission(s):
        <code>customer_information:customers:read</code>. This endpoint belongs
        to the <strong>Customer Information</strong> domain, which has a default
        rate limit of <strong>480 requests per minute</strong>.
    delete:
      summary: Delete a customer
      operationId: delete-customer
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read_write
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1500
            example: 19b8de26-77c1-49f1-aa18-019a391603e2
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeletedObject'
              example:
                object: customer
                id: b5b7bfd2-66fb-4091-af50-7c3cdccfdf24
                deleted_at: 1658399423658
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '202':
          description: Accepted. The customer deletion was queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeletedObject'
              example:
                object: customer
                id: b5b7bfd2-66fb-4091-af50-7c3cdccfdf24
                deleted_at: 1658399423658
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
      description: >-
        This endpoint requires the following permission(s):
        <code>customer_information:customers:read_write</code>. This endpoint
        belongs to the <strong>Customer Information</strong> domain, which has a
        default rate limit of <strong>480 requests per minute</strong>.
  /projects/{project_id}/customers/{customer_id}/actions/transfer:
    post:
      summary: >-
        Transfer customer's subscriptions and one-time purchases to another
        customer
      operationId: transfer-customer-data
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read_write
        - customer_information:subscriptions:read_write
        - customer_information:purchases:read_write
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1500
            example: 19b8de26-77c1-49f1-aa18-019a391603e2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - target_customer_id
              properties:
                target_customer_id:
                  nullable: false
                  type: string
                  description: >-
                    The ID of the customer to whom the subscriptions and
                    one-time purchases will be transferred.
                app_ids:
                  nullable: true
                  type: array
                  description: >-
                    Optional. The IDs of the apps to filter the transfer by.
                    When specified, only purchases and subscriptions associated
                    with these apps will be transferred.
                  items:
                    type: string
                    maxLength: 255
                    minLength: 1
                    example: appa2b3c4d5e
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transfer'
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
      description: >-
        This endpoint requires the following permission(s):
        <code>customer_information:customers:read_write</code>,
        <code>customer_information:subscriptions:read_write</code>,
        <code>customer_information:purchases:read_write</code>. This endpoint
        belongs to the <strong>Customer Information</strong> domain, which has a
        default rate limit of <strong>480 requests per minute</strong>.
  /projects/{project_id}/customers/{customer_id}/actions/grant_entitlement:
    post:
      summary: Grant an entitlement to a customer
      description: >-
        Grants an entitlement to a customer unless one already exists. As a side
        effect, a promotional subscription is created. This endpoint requires
        the following permission(s):
        <code>customer_information:customers:read_write</code>. This endpoint
        belongs to the <strong>Customer Information</strong> domain, which has a
        default rate limit of <strong>480 requests per minute</strong>.
      operationId: grant-customer-entitlement
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read_write
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1500
            example: 19b8de26-77c1-49f1-aa18-019a391603e2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - entitlement_id
                - expires_at
              properties:
                entitlement_id:
                  nullable: false
                  type: string
                  description: The ID of the entitlement to grant to the customer.
                  minLength: 1
                  maxLength: 255
                  example: entla1b2c3d4e5
                expires_at:
                  nullable: false
                  type: integer
                  format: int64
                  description: >-
                    The date after which the access to the entitlement expires
                    in ms since epoch.
                  example: 1658399423658
      responses:
        '201':
          description: Entitlement granted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
  /projects/{project_id}/customers/{customer_id}/actions/revoke_granted_entitlement:
    post:
      summary: Revoke a granted entitlement from a customer
      description: >-
        Revokes a granted entitlement from a customer. As a side effect, the
        promotional subscription associated with the granted entitlement is
        expired. This endpoint requires the following permission(s):
        <code>customer_information:customers:read_write</code>. This endpoint
        belongs to the <strong>Customer Information</strong> domain, which has a
        default rate limit of <strong>480 requests per minute</strong>.
      operationId: revoke-customer-granted-entitlement
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read_write
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1500
            example: 19b8de26-77c1-49f1-aa18-019a391603e2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - entitlement_id
              properties:
                entitlement_id:
                  nullable: false
                  type: string
                  description: >-
                    The ID of the granted entitlement to revoke from the
                    customer.
                  minLength: 1
                  maxLength: 255
                  example: entla1b2c3d4e5
      responses:
        '200':
          description: Entitlement revoked successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
  /projects/{project_id}/customers/{customer_id}/actions/assign_offering:
    post:
      summary: Assign or clear an offering override for a customer
      operationId: assign-customer-offering
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - project_configuration:offerings:read
        - customer_information:customers:read_write
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1500
            example: 19b8de26-77c1-49f1-aa18-019a391603e2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - offering_id
              properties:
                offering_id:
                  nullable: true
                  type: string
                  description: >-
                    The ID of the offering to assign to the customer. Set to
                    null to clear any existing override.
                  minLength: 1
                  maxLength: 255
                  example: offrng1b2c3d4e5
      responses:
        '200':
          description: Offering assigned successfully
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
      description: >-
        This endpoint requires the following permission(s):
        <code>project_configuration:offerings:read</code>,
        <code>customer_information:customers:read_write</code>. This endpoint
        belongs to the <strong>Customer Information</strong> domain, which has a
        default rate limit of <strong>480 requests per minute</strong>.
  /projects/{project_id}/customers/{customer_id}/actions/restore_purchase_by_order_id:
    post:
      summary: Restore a Google Play purchase by order ID
      description: >-
        Restores a Google Play purchase to the specified customer using a Google
        Play order ID. This endpoint requires the following permission(s):
        <code>customer_information:customers:read_write</code>. This endpoint
        belongs to the <strong>Customer Information</strong> domain, which has a
        default rate limit of <strong>480 requests per minute</strong>.
      operationId: restore-purchase-by-order-id
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read_write
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1500
            example: 19b8de26-77c1-49f1-aa18-019a391603e2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - order_id
              properties:
                order_id:
                  nullable: false
                  type: string
                  description: The Google Play order ID to restore.
                  minLength: 1
                  example: GPA.1234-5678-9012-34567
      responses:
        '200':
          description: Purchase restored successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
  /projects/{project_id}/customers/{customer_id}/aliases:
    get:
      summary: Get a list of the customer's aliases
      operationId: list-customer-aliases
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1500
            example: 19b8de26-77c1-49f1-aa18-019a391603e2
        - name: starting_after
          in: query
          required: false
          description: >-
            Pagination cursor. Pass the id of the last item from the previous
            page to fetch the next page; omit for the first page.
          schema:
            type: string
            example: ent12354
        - name: limit
          in: query
          required: false
          description: >-
            Maximum number of items to return per page. Values below 1 or above
            100 are clamped to that range rather than rejected.
          schema:
            type: integer
            example: 10
            default: 20
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCustomerAliases'
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
      description: >-
        This endpoint requires the following permission(s):
        <code>customer_information:customers:read</code>. This endpoint belongs
        to the <strong>Customer Information</strong> domain, which has a default
        rate limit of <strong>480 requests per minute</strong>.
  /projects/{project_id}/customers/{customer_id}/attributes:
    get:
      summary: Get a list of the customer's attributes
      operationId: list-customer-attributes
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1500
            example: 19b8de26-77c1-49f1-aa18-019a391603e2
        - name: starting_after
          in: query
          required: false
          description: >-
            Pagination cursor. Pass the id of the last item from the previous
            page to fetch the next page; omit for the first page.
          schema:
            type: string
            example: ent12354
        - name: limit
          in: query
          required: false
          description: >-
            Maximum number of items to return per page. Values below 1 or above
            100 are clamped to that range rather than rejected.
          schema:
            type: integer
            example: 10
            default: 20
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCustomerAttributes'
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
      description: >-
        This endpoint requires the following permission(s):
        <code>customer_information:customers:read</code>. This endpoint belongs
        to the <strong>Customer Information</strong> domain, which has a default
        rate limit of <strong>480 requests per minute</strong>.
    post:
      summary: Set a customer's attributes
      operationId: set-customer-attributes
      x-revenuecat-rate-limiting-domain: customer_information
      x-scopes:
        - customer_information:customers:read_write
      x-release-status: public
      tags:
        - Customer
      parameters:
        - name: project_id
          description: ID of the project
          required: true
          in: path
          schema:
            type: string
            maxLength: 255
            example: proj1ab2c3d4
        - name: customer_id
          in: path
          description: ID of the customer
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1500
            example: 19b8de26-77c1-49f1-aa18-019a391603e2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - attributes
              properties:
                attributes:
                  type: array
                  nullable: false
                  minItems: 1
                  maxItems: 50
                  items:
                    type: object
                    additionalProperties: false
                    required:
                      - name
                      - value
                    properties:
                      name:
                        description: The name of the attribute
                        nullable: false
                        minLength: 1
                        maxLength: 40
                        oneOf:
                          - $ref: '#/components/schemas/CustomerAttributeReservedName'
                          - $ref: '#/components/schemas/CustomerAttributeCustomName'
                        example: $email
                      value:
                        description: >-
                          The value of the attribute. Use null to delete the
                          attribute.
                        type: string
                        maxLength: 500
                        nullable: true
              example:
                attributes:
                  - name: $email
                    value: support@revenuecat.com
                  - name: $displayName
                    value: John Appleseed
                  - name: my_custom_attr
                    value: custom value
      responses:
        '200':
          description: Success. The customer attributes were set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCustomerAttributes'
          headers:
            RevenueCat-Rate-Limit-Current-Usage:
              $ref: '#/components/headers/RateLimitCurrentUsage'
            RevenueCat-Rate-Limit-Current-Limit:
              $ref: '#/components/headers/RateLimitCurrentLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/InternalError'
      description: >-
        This endpoint requires the following permission(s):
        <code>customer_information:customers:read_write</code>. This endpoint
        belongs to the <strong>Customer Information</strong> domain, which has a
        default rate limit of <strong>480 requests per minute</strong>.
components:
  schemas:
    ListCustomers:
      type: object
      required:
        - items
        - next_page
        - object
        - url
      title: CustomerList
      properties:
        object:
          description: >-
            String representing the object's type. Objects of the same type
            share the same value. Always has the value `list`.
          enum:
            - list
          type: string
        items:
          description: Details about each object.
          items:
            $ref: '#/components/schemas/Customer'
          type: array
        next_page:
          description: >-
            URL to access the next page of the project's customers. If not
            present / null, there is no next page
          type: string
          nullable: true
          example: /v2/projects/projec1a2b3c4d/customers?starting_after=223xx1100
        url:
          description: The URL where this list can be accessed.
          maxLength: 5000
          type: string
          example: /v2/projects/projec1a2b3c4d/customers
      additionalProperties: false
    CustomerAttributeReservedName:
      type: string
      enum:
        - $ad
        - $adGroup
        - $adjustId
        - $airbridgeDeviceId
        - $airshipChannelId
        - $amazonAdId
        - $amplitudeDeviceId
        - $amplitudeUserId
        - $appleRefundHandlingPreference
        - $appleAdsAdGroupId
        - $appleAdsAdId
        - $appleAdsCampaignId
        - $appleAdsCountryOrRegion
        - $claimType
        - $conversionType
        - $appleAdsKeywordId
        - $appleAdsOrgId
        - $supplyPlacement
        - $apnsTokens
        - $appsflyerId
        - $appsflyerSharingFilter
        - $attConsentStatus
        - $branchId
        - $brazeAliasLabel
        - $brazeAliasName
        - $campaign
        - $clevertapId
        - $creative
        - $customerioId
        - $displayName
        - $email
        - $fbAnonId
        - $fcmTokens
        - $firebaseAppInstanceId
        - $gpsAdId
        - $idfa
        - $idfv
        - $ip
        - $iterableCampaignId
        - $iterableTemplateId
        - $iterableUserId
        - $keyword
        - $kochavaDeviceId
        - $mediaSource
        - $mixpanelDistinctId
        - $mparticleId
        - $onesignalId
        - $onesignalUserId
        - $phoneNumber
        - $posthogUserId
        - $telemetryDeckUserId
        - $telemetryDeckAppId
        - telemetry_deck_user_id
        - telemetry_deck_app_id
        - $segmentId
        - $solarEngineDistinctId
        - $solarEngineAccountId
        - $solarEngineVisitorId
        - $tenjinId
        - $deviceVersion
        - $androidId
        - $appstackId
        - $fbc
        - $fbp
        - $intercomContactId
        - $pageUrl
        - $userAgent
      example: $email
    CustomerAttributeCustomName:
      type: string
      maxLength: 40
      pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
      example: opt_into_marketing
    Customer:
      type: object
      required:
        - id
        - project_id
        - first_seen_at
        - last_seen_at
        - last_seen_app_version
        - last_seen_country
        - last_seen_platform
        - last_seen_platform_version
        - object
      properties:
        object:
          description: >-
            String representing the object's type. Objects of the same type
            share the same value.
          enum:
            - customer
          type: string
        id:
          type: string
          maxLength: 1500
          example: 19b8de26-77c1-49f1-aa18-019a391603e2
        project_id:
          nullable: false
          description: ID of the project to which the customer belongs
          minLength: 1
          maxLength: 20
          type: string
          example: proj1ab2c3d4
        first_seen_at:
          nullable: false
          description: >-
            The earliest date we have for this customer, whichever comes first:
            when the SDK first saw them, their first purchase, the App Store
            install date, or when the record was created. Matches the 'First
            seen or purchased' date shown in the dashboard.
          type: integer
          format: int64
          example: 1658399423658
        last_seen_at:
          nullable: true
          description: The last time the customer was seen
          type: integer
          format: int64
          example: 1658399423658
        last_seen_app_version:
          nullable: true
          description: The last app version the customer was seen on
          type: string
          example: 1.0.0
        last_seen_country:
          nullable: true
          description: The last country the customer was seen in
          type: string
          example: US
        last_seen_platform:
          nullable: true
          description: The last platform the customer was seen on
          type: string
          example: android
        last_seen_platform_version:
          nullable: true
          description: The last platform version the customer was seen on
          type: string
          example: '35'
        active_entitlements:
          description: >-
            List of the entitlements currently active for the customer. This
            property is only available in the "Get a customer" endpoint.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ListCustomerActiveEntitlements'
        experiment:
          description: The experiment enrollment object
          nullable: true
          $ref: '#/components/schemas/ExperimentEnrollment'
        attributes:
          description: >-
            List of the attributes of the customer. This is an expandable
            property, only available in the "Get a customer" endpoint.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ListCustomerAttributes'
      additionalProperties: false
    DeletedObject:
      type: object
      required:
        - object
        - id
        - deleted_at
      properties:
        object:
          description: The type of the deleted object
          enum:
            - app
            - chart_annotation
            - customer
            - discount
            - entitlement
            - experiment
            - offering
            - package
            - paywall
            - product
            - virtual_currency
            - webhook_integration
          type: string
        id:
          description: The ID of the deleted object
          nullable: false
          type: string
        deleted_at:
          nullable: false
          type: integer
          format: int64
          description: The date when the object was deleted in ms since epoch
          example: 1658399423658
      additionalProperties: false
    Transfer:
      type: object
      title: TransferResult
      required:
        - source_customer
        - target_customer
      properties:
        source_customer:
          description: The original customer before the transfer
          $ref: '#/components/schemas/Customer'
        target_customer:
          description: The target customer after the transfer
          $ref: '#/components/schemas/Customer'
      additionalProperties: true
    ListCustomerAliases:
      type: object
      required:
        - items
        - next_page
        - object
        - url
      title: CustomerAliasList
      properties:
        object:
          description: >-
            String representing the object's type. Objects of the same type
            share the same value. Always has the value `list`.
          enum:
            - list
          type: string
        items:
          description: Details about each object.
          items:
            $ref: '#/components/schemas/CustomerAlias'
          type: array
        next_page:
          description: >-
            URL to access the next page of the customer's aliases. If not
            present / null, there is no next page
          type: string
          nullable: true
          example: >-
            /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/aliases?starting_after=9fjeja8fjed
        url:
          description: The URL where this list can be accessed.
          maxLength: 5000
          type: string
          example: >-
            /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/aliases
      additionalProperties: false
    ListCustomerAttributes:
      type: object
      required:
        - items
        - next_page
        - object
        - url
      title: CustomerAttributeList
      properties:
        object:
          description: >-
            String representing the object's type. Objects of the same type
            share the same value. Always has the value `list`.
          enum:
            - list
          type: string
        items:
          description: Details about each object.
          items:
            $ref: '#/components/schemas/CustomerAttribute'
          type: array
        next_page:
          description: >-
            URL to access the next page of the customer's aliases. If not
            present / null, there is no next page
          type: string
          nullable: true
          example: >-
            /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/attributes?starting_after=myCustomAttribute
        url:
          description: The URL where this list can be accessed.
          maxLength: 5000
          type: string
          example: >-
            /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/attributes
      additionalProperties: false
    Error:
      type: object
      required:
        - type
        - message
        - retryable
        - object
      properties:
        object:
          description: >-
            String representing the object's type. Objects of the same type
            share the same value.
          enum:
            - error
          type: string
          example: error
        type:
          description: The error type
          type: string
          nullable: false
          enum:
            - parameter_error
            - resource_already_exists
            - resource_missing
            - idempotency_error
            - rate_limit_error
            - authentication_error
            - authorization_error
            - store_error
            - server_error
            - resource_locked_error
            - unprocessable_entity_error
            - invalid_request
            - entity_references_archived_entities
          example: parameter_error
        param:
          description: >-
            If the error is parameter-specific, the parameter related to the
            error
          type: string
          nullable: true
          example: customer_id
        doc_url:
          description: A URL to more information about the error reported
          type: string
          nullable: false
          example: https://errors.rev.cat/parameter-error
        message:
          type: string
          description: A message describing the reason of the error
          nullable: false
          example: id shouldn't be longer than 1,500 characters
        retryable:
          description: Indicates if the error is retryable or not
          type: boolean
          nullable: false
          example: false
        backoff_ms:
          description: >-
            The ms the client should wait before retrying the request. Only
            present for retryable errors.
          type: integer
          nullable: true
          example: null
        referenced_object_ids:
          description: >-
            The IDs of related objects relevant to the error, such as the
            archived entities that need to be made active before the operation
            can succeed.
          type: array
          items:
            type: string
          example:
            - prodabcd1234
            - prodwxyz5678
      additionalProperties: false
    ListCustomerActiveEntitlements:
      type: object
      required:
        - items
        - next_page
        - object
        - url
      title: CustomerActiveEntitlementList
      description: >-
        List of the entitlements currently active for the customer. This
        property is only available in the "Get a customer" endpoint.
      properties:
        object:
          description: >-
            String representing the object's type. Objects of the same type
            share the same value. Always has the value `list`.
          enum:
            - list
          type: string
        items:
          description: Details about each object.
          items:
            $ref: '#/components/schemas/CustomerEntitlement'
          type: array
        next_page:
          description: >-
            URL to access the next page of the customer's active entitlements.
            If not present / null, there is no next page
          type: string
          nullable: true
          example: >-
            /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/active_entitlements?starting_after=entlab21dac
        url:
          description: The URL where this list can be accessed.
          maxLength: 5000
          type: string
          example: >-
            /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/active_entitlements
      additionalProperties: false
    ExperimentEnrollment:
      type: object
      required:
        - id
        - name
        - variant
        - object
      nullable: true
      properties:
        object:
          description: >-
            String representing the object's type. Objects of the same type
            share the same value.
          enum:
            - experiment_enrollment
          type: string
        id:
          type: string
          maxLength: 1500
        name:
          type: string
          maxLength: 1500
        variant:
          nullable: false
          description: >-
            The variant of the Experiment that the Customer was or is assigned
            to, where 'a' represents the Control, and 'b' represents the
            Treatment.
          minLength: 1
          maxLength: 1
          type: string
          example: a
      additionalProperties: false
    CustomerAlias:
      type: object
      required:
        - id
        - created_at
        - object
      properties:
        object:
          description: >-
            String representing the object's type. Objects of the same type
            share the same value.
          enum:
            - customer.alias
          type: string
        id:
          type: string
          maxLength: 1500
          example: 19b8de26-77c1-49f1-aa18-019a391603e2
        created_at:
          nullable: false
          description: The time when the alias was created
          type: integer
          format: int64
          example: 1658399423658
      additionalProperties: false
    CustomerAttribute:
      type: object
      required:
        - name
        - value
        - updated_at
        - object
      properties:
        object:
          description: >-
            String representing the object's type. Objects of the same type
            share the same value.
          enum:
            - customer.attribute
          type: string
        name:
          nullable: false
          description: >-
            The name of the attribute. Reserved attributes are prefixed with a
            `$`.
          type: string
          maxLength: 1500
          example: $email
        value:
          nullable: true
          description: The value of the attribute.
          type: string
          example: garfield@revenuecat.com
        updated_at:
          nullable: false
          description: The time when the attribute was last updated.
          type: integer
          format: int64
          example: 1658399423658
      additionalProperties: false
    CustomerEntitlement:
      type: object
      required:
        - entitlement_id
        - expires_at
        - object
      properties:
        object:
          description: >-
            String representing the object's type. Objects of the same type
            share the same value.
          enum:
            - customer.active_entitlement
          type: string
        entitlement_id:
          nullable: false
          description: ID of the entitlement granted to the customer
          minLength: 1
          maxLength: 255
          type: string
          example: entla1b2c3d4e5
        expires_at:
          nullable: true
          description: >-
            The date after which the access to the entitlement expires in ms
            since epoch
          type: integer
          format: int64
          example: 1658399423658
      additionalProperties: false
  headers:
    RateLimitCurrentUsage:
      required: true
      description: >-
        The current number of requests used for the current limit (including the
        current request).
      schema:
        type: integer
      example: 25
    RateLimitCurrentLimit:
      required: true
      description: The rate limit for this endpoint, expressed in requests per minute.
      schema:
        type: integer
      example: 30
    RateLimitRetryAfter:
      required: true
      description: >-
        The number of seconds to wait before retrying a rate limited
        request.Only present when a request is rate limited.
      schema:
        type: integer
      example: 10
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - parameter_error
                      - invalid_request
          examples:
            parameter_error:
              value:
                object: error
                type: parameter_error
                param: customer_id
                message: id is too long
                retryable: false
                doc_url: https://errors.rev.cat/parameter-error
            invalid_request:
              value:
                object: error
                type: invalid_request
                message: Content-Type not application/json
                retryable: false
                doc_url: https://errors.rev.cat/invalid-request
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - authentication_error
            example:
              object: error
              type: authentication_error
              message: Invalid API key
              retryable: false
              doc_url: https://errors.rev.cat/authentication-error
    Forbidden:
      description: Access denied
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - authorization_error
            example:
              object: error
              type: authorization_error
              message: You're not authorized to access this resource
              retryable: false
              doc_url: https://errors.rev.cat/authorization-error
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - resource_missing
            example:
              object: error
              type: resource_missing
              message: Resource not found
              retryable: false
              doc_url: https://errors.rev.cat/resource-missing
    Locked:
      description: Locked
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - resource_locked_error
            example:
              object: error
              type: resource_locked_error
              message: The resource is currently being modified by a concurrent request
              retryable: true
              doc_url: https://errors.rev.cat/resource-locked-error
              backoff_ms: 1000
    RateLimited:
      description: >-
        The request could not be completed because the rate limiting domain for
        this endpoint is currently at its limit for this project.
      headers:
        RevenueCat-Rate-Limit-Current-Usage:
          $ref: '#/components/headers/RateLimitCurrentUsage'
        RevenueCat-Rate-Limit-Current-Limit:
          $ref: '#/components/headers/RateLimitCurrentLimit'
        Retry-After:
          $ref: '#/components/headers/RateLimitRetryAfter'
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - rate_limit_error
            example:
              object: error
              type: rate_limit_error
              message: Rate limit exceeded
              retryable: true
              doc_url: https://errors.rev.cat/rate-limit-error
              backoff_ms: 1000
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - server_error
            example:
              object: error
              type: server_error
              message: There was an internal server error
              retryable: true
              doc_url: https://errors.rev.cat/server-error
              backoff_ms: 1000
    Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - resource_already_exists
                      - idempotency_error
                      - invalid_request
          examples:
            resource_already_exists:
              value:
                object: error
                type: resource_already_exists
                message: Name is already taken
                retryable: false
                doc_url: https://errors.rev.cat/resource-already-exists
            idempotency_error:
              value:
                object: error
                type: idempotency_error
                message: Idempotency key already used for a different request
                retryable: false
                doc_url: https://errors.rev.cat/idempotency-error
            invalid_request:
              value:
                object: error
                type: invalid_request
                message: Request conflicts with the current resource state
                retryable: false
                doc_url: https://errors.rev.cat/invalid-request
    UnprocessableEntity:
      description: Unprocessable entity
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - unprocessable_entity_error
                      - parameter_error
                      - store_error
                      - entity_references_archived_entities
          examples:
            unprocessable_entity:
              value:
                object: error
                type: unprocessable_entity_error
                message: Cannot delete a product that has purchases
                retryable: false
                doc_url: https://errors.rev.cat/unprocessable-entity-error
            parameter_error:
              value:
                object: error
                type: parameter_error
                message: Date must in the future
                retryable: false
                doc_url: https://errors.rev.cat/parameter-error
            store_error:
              value:
                object: error
                type: store_error
                message: There was a problem on the App Store
                retryable: true
                doc_url: https://errors.rev.cat/store-error
                backoff_ms: 1000
            entity_references_archived_entities:
              value:
                object: error
                type: entity_references_archived_entities
                message: >-
                  This offering references inactive products. You will need to
                  make the products active first before making the offering
                  active.
                retryable: false
                doc_url: https://errors.rev.cat/entity-references-archived-entities
                referenced_object_ids:
                  - prodabcd1234
                  - prodwxyz5678
  securitySchemes:
    BearerAuth:
      bearerFormat: auth-scheme
      description: >-
        Bearer HTTP authentication. Allowed headers -- Authorization: Bearer
        <api_key>
      scheme: bearer
      type: http
