---
title: "POST /v2/activities"
method: POST
path: "/v2/activities"
tags: ["activities"]
---

# POST /v2/activities

`POST /v2/activities`

## Query parameters

- `site_id` number

## Request body

- ActivitiesCreateActivityRequestBody
  - `name` string, required — A built-in or custom activity rule name. If you’re tracking a custom rule, this should be the rule identifier; if you’re tracking a built-in activity, the name must be prefixed with a `$`, for example, `$signup`
  - `customer_id` union, required — A unique ID for the customer involved in the activity. This should be your internal ID (from your ecommerce platform) for this customer
    - number
    - string
  - `customer_email` string, required — The email address for the customer
  - `merchant_id` string, nullable — A unique ID used to link this activity to an internal resource in your system. If provided, you can update the state of this activity later using the activity update endpoint
  - `properties` union — A set of properties for this rule. Some rules require certain properties to be set
    - object
      - `url` string, required
    - object
  - `ip_address` string, nullable — The IP address of the customer involved in this activity. Used in combination with user_agent to track referrals
  - `user_agent` string, nullable — The full user agent string of the customer involved in this activity. Used in combination with ip_address to track referrals
  - `date` string, nullable — The date this activity occurred, as an ISO 8601 timestamp. Defaults to now if not provided
  - `referral_id` string, nullable — A LoyaltyLion referral ID
  - `tracking_id` string, nullable — A LoyaltyLion email tracking ID
  - `guest` boolean, nullable — A boolean value indicating if the customer is a guest. The default is true
  - `state` string, nullable — This field is no longer supported and will be ignored. Tracked activities will have an initial state according to the matching rule, which can be configured in your LoyaltyLion admin

## Response `201`

201

## Other responses

- `400` — Bad Request
- `401` — 401
- `403` — 403
- `422` — 422

---

[API](https://skmtc.net/loyaltylion/apis/loyaltylion-admin-api.md) · [All operations](https://skmtc.net/loyaltylion/apis/loyaltylion-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/loyaltylion/loyaltylion-admin-api/revisions/4cfed13b45bc/schema)
