TagMangoTagMango Docs
Account

Create or find user

POST
/api/v1/external/users

Overview

This endpoint creates a new user on the customhost or returns an existing user if a match is found by email or phone. At least one of email or phone is required.

AuthorizationBearer <token>

In: header

Header Parameters

x-whitelabel-host*string

Host name of the dashboard, ex: mydomain.tagmango.com

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://api-prod-new.tagmango.com/api/v1/external/users" \  -H "x-whitelabel-host: string" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com",    "phone": 9876543210,    "name": "John Doe",    "country": "IN"  }'
{
  "_id": "6659ca9e5f2acb7abfdcd8fd",
  "name": "John Doe",
  "email": "john.doe@example.com",
  "phone": 1234567890,
  "country": "India",
  "dialCode": "+91",
  "currency": "USD",
  "isNew": true
}
{
  "code": 400,
  "type": "Bad request",
  "statusMessage": "BAD_REQUEST",
  "message": "Invalid request",
  "success": false
}
{
  "code": 401,
  "type": "Unauthorized",
  "statusMessage": "UNAUTHORIZED",
  "message": "Invalid token",
  "success": false
}