---
agentTools:
  projectIndex: https://docs.nvecta.com/llms.txt
---

# Create/Update User Profile and Log Event

This API makes it easy to manage user profiles and log events at the same time. You can create or update a user’s profile and record an event in one go. This helps ensure that events are always linked to the users, making your data more reliable and saving you the hassle of making multiple API calls.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "<h2>User's REST API can be used to :</h2> <p>Getting a list of user profiles by event name </p>\n<p>Enables you to create or update user profiles.</p>\n<p>Enables you to get the total number of profiles that match an event query.</p>\n<p>Enables you to delete a user profile.</p> <p>Enables you to get a user profile from userID</p>\n\n<h2>Event's REST API can be used to :</h2>\n<p>Enables you to create or update events .</p>\n<p>Enables you to track event.</p>\n<p>Enables you to count event's users .</p> <p>Enables you to get details of users performed an event</p>\n",
    "version": "1.0.0",
    "title": "Users & Events Api ",
    "termsOfService": "http://swagger.io/terms/",
    "contact": {
      "email": "support@notifyvisitors.com"
    }
  },
  "tags": [
    {
      "name": "Users"
    }
  ],
  "paths": {
    "/user_event/create": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create/Update User Profile and Log Event",
        "description": "This API makes it easy to manage user profiles and log events at the same time. You can create or update a user’s profile and record an event in one go. This helps ensure that events are always linked to the users, making your data more reliable and saving you the hassle of making multiple API calls.",
        "operationId": "user_event",
        "parameters": [
          {
            "name": "x-brand-id",
            "in": "header",
            "description": "Brand id of notifyvisitors account",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Api key of notifyvisitors",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "If you are accessing this api as a partner app, use access_token as bearer token. x-brand-id & x-api-key are not required.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "description": "application/json",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/user_event"
              }
            }
          },
          "description": "Body Parameter",
          "required": true
        },
        "responses": {
          "200": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/inline_response_200_3"
                }
              }
            }
          },
          "400": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/inline_response_400_1"
                }
              }
            }
          },
          "401": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/inline_response_401"
                }
              }
            }
          },
          "403": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/inline_response_403"
                }
              }
            }
          },
          "500": {
            "description": "status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/inline_response_500"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://analytics.notifyvisitors.com/api/v1"
    }
  ],
  "components": {
    "schemas": {
      "user_event": {
        "type": "object",
        "properties": {
          "nv": {
            "type": "object",
            "description": "contains userid, event name, user attributes and event attributes",
            "properties": {
              "userID": {
                "type": "string",
                "format": "string",
                "description": "Unique identification id of the user"
              },
              "event_name": {
                "type": "string",
                "format": "string",
                "description": "Name of the event"
              },
              "user_params": {
                "type": "object",
                "description": "object contains user data",
                "properties": {
                  "name": {
                    "type": "string",
                    "format": "string",
                    "description": "name of user"
                  },
                  "first_name": {
                    "type": "string",
                    "format": "string",
                    "description": "First name of user"
                  },
                  "last_name": {
                    "type": "string",
                    "format": "string",
                    "description": "Last name of user"
                  },
                  "email": {
                    "type": "string",
                    "format": "string",
                    "description": "Email"
                  },
                  "mobile": {
                    "type": "string",
                    "format": "string",
                    "description": "Mobile Number"
                  },
                  "birth_date": {
                    "type": "string",
                    "format": "string",
                    "description": "Birth Date"
                  },
                  "gender": {
                    "type": "string",
                    "format": "string",
                    "description": "Gender"
                  },
                  "email_opt_in": {
                    "type": "integer",
                    "format": "integer",
                    "description": "Email Opt In"
                  },
                  "sms_opt_in": {
                    "type": "integer",
                    "format": "integer",
                    "description": "Sms Opt In"
                  },
                  "whatsapp_opt_in": {
                    "type": "integer",
                    "format": "integer",
                    "description": "Whatsapp Opt In"
                  }
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              "attributes": {
                "type": "object",
                "format": "object",
                "description": "Event attributes",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "inline_response_401": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "example": "Authentication fail",
            "description": "Authentication fail"
          },
          "status_code": {
            "type": "number",
            "example": 401,
            "description": "401"
          }
        }
      },
      "inline_response_403": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "example": "Require Parameters Missing",
            "description": "Require Parameters Missing"
          },
          "status_code": {
            "type": "number",
            "example": 403,
            "description": "403"
          }
        }
      },
      "inline_response_500": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "example": "Request Fail",
            "description": "Request Fail"
          },
          "status_code": {
            "type": "number",
            "example": 500,
            "description": "500"
          }
        }
      },
      "inline_response_400_1": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "example": "Bad Request",
            "description": "Bad Request"
          },
          "status": {
            "type": "number",
            "example": 400,
            "description": "400"
          }
        }
      },
      "inline_response_200_3_records_platformInfo": {
        "type": "object",
        "properties": {
          "platform": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "lang": {
            "type": "string"
          }
        }
      },
      "inline_response_200_3_records": {
        "type": "object",
        "properties": {
          "userID": {
            "type": "number"
          },
          "profileData": {
            "type": "object",
            "properties": {}
          },
          "event": {
            "type": "object",
            "properties": {}
          },
          "platformInfo": {
            "$ref": "#/components/schemas/inline_response_200_3_records_platformInfo"
          }
        }
      },
      "inline_response_200_3": {
        "type": "object",
        "properties": {
          "status_code": {
            "type": "number",
            "example": 200,
            "description": "200"
          },
          "records": {
            "$ref": "#/components/schemas/inline_response_200_3_records"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 95,
      "1": 60,
      "2": 222,
      "3": 143,
      "4": 188,
      "5": 238,
      "6": 158,
      "7": 3,
      "8": 35,
      "9": 194,
      "10": 175,
      "11": 234
    }
  }
}
```