LogSnag Docs
Home
  • ⚡Welcome
  • Quick Start
  • LogSnag for SaaS
  • ⚒️SDKs
    • Node
    • React
    • Next
    • Vue
    • Deno
    • Web
    • Python
  • 📖API Reference
    • Log
    • Identify
    • Insight
    • Insight Mutate
  • 🧳Tools
    • Feedback Widget
  • 🤝Integrations
    • Zapier
    • Bubble
    • Unofficial
Powered by GitBook
On this page
  • Add properties to user profiles.
  • Usage
  • Properties Schema

Was this helpful?

  1. API Reference

Identify

PreviousLogNextInsight

Last updated 1 year ago

Was this helpful?

The identify endpoint lets you add key-value properties to a user profile. This endpoint is optional and useful for getting a complete picture of a user just by looking at their profile, and additionally, these properties can be used for filtering and searching.

For example, you may add a user's email address, their plan, last payment date, etc., to their profile and then use these properties to filter and search for users, such as searching for all users on a specific plan.

Add properties to user profiles.

POST https://api.logsnag.com/v1/identify

Headers

Name
Type
Description

Content-Type

String

application/json

Authorization

String

Bearer <TOKEN>

Request Body

Name
Type
Description

project*

String

Project name

user_id*

String

User ID

properties*

Key/Value

User Properties

{
    // Response
}

Important: Fields ending with an * are required in your request!

Usage

It's important to remember that property keys override each other. For example, imagine that users of our product start with a free trial and then upgrade to a paid plan. We want to track the plan the user is currently on and other properties like their name and email address. We can do this by calling the identify endpoint once the user signs up and again when upgrading to a paid plan.

{
    "project": "my-saas",
    "user_id": "123",
    "properties": {
        "plan": "free",
        "name": "John Doe",
        "email": "john@foo.com",
        "username": "johndoe"
    }
}

Later on, when the user upgrades to a paid plan, we can call the identify endpoint again with the new plan value:

{
    "project": "my-saas",
    "user_id": "123",
    "properties": {
        "plan": "premium"
    }
}

Properties Schema

Note that property keys may only contain lowercase alphabet characters and are optionally separated with - dashes. For example, plan and plan-type are valid tag keys, but Plan and plan_type are not. Values may be any string, boolean, or number.

📖