API Reference - Users

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108047

← Back to API Reference | Getting Started

Users

Users (members) are the core of every Brilliant Directories website. This resource maps to the users_data database table. Every user belongs to a membership level (subscription type) and has a status code that controls their access to the site.

Model name in URL: user — DB table: users_data

The User Object

FieldTypeDescription
user_idintegerUnique user ID (primary key, read-only)
first_namestringUser's first name
last_namestringUser's last name
emailstringEmail address — must be unique across the site required on create
passwordstringPassword (plain text on create/update; stored as hash) required on create
subscription_idintegerMembership level ID required on create
activeintegerAccount status: 1=Inactive, 2=Active, 3=Cancelled, 4=On Hold, 5=Past Due
companystringBusiness or company name
phone_numberstringPhone number
address1stringStreet address line 1
address2stringStreet address line 2
citystringCity
zip_codestringZIP or postal code
state_codestring2-letter state/province code (e.g. CA)
state_lnstringFull state/province name (e.g. California)
country_codestring2-letter country code (e.g. US)
country_lnstringFull country name (e.g. United States)
websitestringUser's website URL
twitterstringTwitter/X profile URL
youtubestringYouTube channel URL
facebookstringFacebook profile/page URL
linkedinstringLinkedIn profile URL
instagramstringInstagram profile URL
pintereststringPinterest profile URL
snapchatstringSnapchat handle
whatsappstringWhatsApp contact number
about_metextAbout Me biography (HTML allowed)
quotestringTagline or quote displayed on profile
experienceintegerYear experience began (e.g. 2015)
affiliationtextProfessional affiliations
awardstextAwards and achievements
credentialstextProfessional credentials or certifications
positionstringJob title or position
profession_idintegerIndustry/profession category ID
featuredinteger1 if user is featured, 0 otherwise
nationwideinteger1 if user serves clients nationwide
latnumberLatitude coordinate
lonnumberLongitude coordinate
signup_datestringDate user signed up (format: YYYYMMDDHHmmss)
last_loginstringDate/time of last login (format: YYYYMMDDHHmmss)
modtimetimestampLast modified timestamp (auto-updated)
filenamestringURL-friendly profile slug
parent_idintegerParent user ID for sub-accounts
verifiedinteger1 if email verified
blogtextBlog URL or blog content
no_geostringFlag to disable geocoding for this user
user_consenttextRecord of user consent (GDPR/privacy compliance)
search_descriptiontextCustom description displayed in search results
tokenstringUnique user token (auto-generated)
cookiestringSession cookie token
ref_codestringReferral code or signup source (e.g. Manually Added)
bitlystringBitly URL shortening flag or shortened URL
facebook_idstringFacebook account ID (for Facebook login integration)
google_idstringGoogle account ID (for Google login integration)
cvtextCurriculum vitae or resume content
work_experiencetextWork experience details
rep_matterstextBusiness hours or additional reputation information
gmapstringGoogle Maps embed URL or place ID
listing_typestringListing type classification (e.g. Individual, Business)

Special Update Parameters

ParameterTypeDescription
member_tag_actionintegerSet to 1 to apply tag changes
member_tagsstringComma-separated tag IDs to assign (e.g. 1,2,3)
credit_actionstringadd, deduct, or override credits
credit_amountnumberCredit amount for the credit action
images_actionstringremove_all, remove_cover_image, remove_logo_image, or remove_profile_image
servicesstringServices in format category=>service1,service2
auto_geocodeinteger1 to automatically geocode the user's address

List Users

GET /api/v2/user/get

Returns a paginated list of users. Supports filtering and sorting via query parameters.

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/user/get?limit=25" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "total": 84,
  "current_page": 1,
  "total_pages": 4,
  "next_page": "MipfKjI1",
  "message": [
    {
      "user_id": 1,
      "first_name": "Jane",
      "last_name": "Smith",
      "email": "jane@example.com",
      "company": "Acme Corp",
      "active": 2,
      "subscription_id": 1,
      "city": "Los Angeles",
      "state_code": "CA",
      "country_code": "US",
      "signup_date": "20240115143000"
    },
    ...
  ]
}

Retrieve a User

GET /api/v2/user/get/{user_id}

Returns a single user by their user_id.

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/user/get/42" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "total": 1,
  "current_page": 1,
  "total_pages": 1,
  "message": [
    {
      "user_id": 42,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@example.com",
      "company": "Tech Solutions LLC",
      "active": 2,
      "subscription_id": 3,
      "phone_number": "555-867-5309",
      "city": "San Francisco",
      "state_code": "CA",
      "country_code": "US",
      "website": "https://www.techsolutions.com",
      "signup_date": "20230901090000"
    }
  ]
}

Create a User

POST /api/v2/user/create

Creates a new user. The email, password, and subscription_id fields are required.

Required Fields

ParameterTypeDescription
emailstringRequired
passwordstringRequired
subscription_idintegerRequired — membership level ID

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/user/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "email=jane@example.com" \
  -d "password=SecurePass123" \
  -d "subscription_id=1" \
  -d "first_name=Jane" \
  -d "last_name=Smith" \
  -d "company=Acme+Corp" \
  -d "phone_number=555-555-1234" \
  -d "city=Los+Angeles" \
  -d "state_code=CA" \
  -d "country_code=US"

Example Response

Copy
{
  "status": "success",
  "message": {
    "user_id": 101,
    "first_name": "Jane",
    "last_name": "Smith",
    "email": "jane@example.com",
    "company": "Acme Corp",
    "active": 1,
    "subscription_id": 1
  }
}

Update a User

PUT /api/v2/user/update

Updates an existing user. The user_id is required in the request body. Only include the fields you want to change.

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/user/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "user_id=101" \
  -d "company=New+Company+Name" \
  -d "active=2" \
  -d "phone_number=555-999-8888"

Example Response

Copy
{
  "status": "success",
  "message": {
    "user_id": 101,
    "first_name": "Jane",
    "last_name": "Smith",
    "company": "New Company Name",
    "active": 2,
    "phone_number": "555-999-8888"
  }
}

Delete a User

DELETE /api/v2/user/delete

Permanently deletes a user and all associated data. The user_id is required. Set delete_images to 1 to also remove the user's uploaded image files.

Example Request

Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/user/delete" \
  -H "X-Api-Key: your-api-key-here" \
  -d "user_id=101" \
  -d "delete_images=1"

Example Response

Copy
{
  "status": "success",
  "message": "user record was deleted"
}

Search Users

POST /api/v2/user/search

Performs a full member directory search with keyword, category, and location filtering. This endpoint mirrors the front-end member search functionality.

Search Parameters

ParameterTypeDescription
qstringKeyword to search across member data
pidintegerTop-level category ID to filter by
tidintegerSub-level category ID to filter by
ttidintegerSub-sub-level category ID to filter by
addressstringLocation to search near (e.g. Los Angeles, CA)
sortstringSort order: reviews, name ASC, name DESC, last_name_asc, last_name_desc
pageintegerPage number
limitintegerResults per page
dynamicintegerSet to 1 to use Dynamic Category Filter search mode
output_typestringarray (default) or html

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/user/search" \
  -H "X-Api-Key: your-api-key-here" \
  -d "q=plumber" \
  -d "address=Chicago%2C+IL" \
  -d "limit=10"

User Login

POST /api/v2/user/login

Validates a user's email and password. Returns a success or error status indicating whether the credentials are valid. This endpoint does not return user profile data — use GET /api/v2/user/get to retrieve user details after confirming credentials.

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/user/login" \
  -H "X-Api-Key: your-api-key-here" \
  -d "email=jane@example.com" \
  -d "password=SecurePass123"

Example Response

Copy
{
  "status": "success",
  "message": "credentials are valid"
}

User Transactions

POST /api/v2/user/transactions

Returns billing transactions for a specific user. Pass the user's user_id as a POST body parameter.

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/user/transactions" \
  -H "X-Api-Key: your-api-key-here" \
  -d "user_id=42"

User Subscriptions

POST /api/v2/user/subscriptions

Returns the subscription/membership history for a specific user. Pass the user's user_id as a POST body parameter.

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/user/subscriptions" \
  -H "X-Api-Key: your-api-key-here" \
  -d "user_id=42"