Identity

Link Identity Rows

Changed on

Moves a guest id's experiment and analytics rows to the signed-in id, from the app, with the publishable key. Use it to keep a pre-login funnel and experiment assignment when the person logs in.

Without link_token this endpoint never moves purchases and never touches a customer record. It moves experiment impressions, assignments, exposures, outcome rows and funnel events from previous_user_id (or previous_install_id) to user_id. It skips an id that a live account owns, and an id that was already merged away, and answers status: "skipped" with zero counts. Where user_id already holds a row for the same experiment, that row wins and the guest's row is left in place. Nothing is dropped.

With link_token it is a full reconcile, the same as Present Link Token: purchases move too, the same limits and refusals apply, and the response also carries reconciliation_id. Ids sent beside a token must both be present and match the token, or neither.

With a zs_anon_ previous_user_id (an id minted by iOS 1.7.0, Android 1.4.0 and Flutter 1.9.0 or later) and no token, the endpoint folds the anonymous id into the account. If user_id has no history yet (no purchases, entitlements, Stripe customer or funnel events), everything moves: purchases, entitlements, events and experiment assignments, and identity.reconciled fires with actor of identity_link. If user_id already has history, nothing moves and the answer is switched. A retry returns the same result. Ids without the prefix behave as described above. user_id must not start with zs_anon_: that prefix is reserved and answers 400 invalid_user_id. The merge is authorized by the publishable key alone, so make user ids hard to guess.

Without a token it is rate limited to 60 calls a minute per client IP and 6,000 a minute per app. Over a limit the response is 429 with Retry-After.

post/iap/identity-link/

Request

  • Base URL
    https://api.zerosettle.io/v1
  • URL
    https://api.zerosettle.io/v1/iap/identity-link/
  • Auth
    API key in header X-ZeroSettle-Key

Request body

previous_user_idstring

The guest id to move rows from. Send this or previous_install_id.

previous_install_idstring

The raw SDK install id, as an alternative to previous_user_id.

user_idstring

The signed-in id to move rows to.

link_tokenstring

Optional. A link token from Create Link Token. With it, this is a full reconcile.

Response

Processed.

status'ok' | 'skipped' | 'merged' | 'switched'

skipped when the guest id belongs to a live account or was merged away and no token was sent. Counts are then zero. merged and switched are only for a zs_anon_ previous_user_id: merged means the anonymous id was folded into the account (also on a retry), switched means the account already had history, so nothing moved.

impressions_movedinteger
impressions_droppedinteger
assignments_movedinteger
assignments_droppedinteger
sticky_assignments_movedinteger
sticky_assignments_droppedinteger
sticky_assignments_collidedinteger
sticky_assignments_protectedinteger
exposures_movedinteger
exposures_droppedinteger
ledger_rows_movedinteger
funnel_events_movedinteger
reconciliation_idunknown

Changes

    • breaking

      added to the response body oneOf list for the response status

    • breaking

      the response's body type changed from object to no type for status

    • breaking

      the response property became nullable for the status

    • breaking

      removed the required property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      added the new merged enum value to the response property for the response status

    • warning

      added the new switched enum value to the response property for the response status

    • info

      endpoint added