Skip to content

Profiles API

REST API for user profile management.

Namespace: frs-users/v1Base URL: /wp-json/frs-users/v1/

Endpoints

List Profiles

GET /profiles

Parameters

ParameterTypeDefaultDescription
pageint1Page number
per_pageint20Items per page (max 100)
rolestring-Filter by role
searchstring-Search name/email
orderbystringlast_nameSort field
orderstringascSort direction

Example

bash
curl 'https://myhub21.com/wp-json/frs-users/v1/profiles?role=loan_officer&per_page=10'

Response

json
{
  "data": [
    {
      "id": 123,
      "user_id": 45,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@example.com",
      "role": "loan_officer",
      "nmls_id": "123456",
      "job_title": "Senior Loan Officer",
      "phone": "555-1234",
      "avatar_url": "https://..."
    }
  ],
  "total": 1,
  "pages": 1,
  "page": 1
}

Get Profile

GET /profiles/{id}

Example

bash
curl 'https://myhub21.com/wp-json/frs-users/v1/profiles/123'

Response

json
{
  "id": 123,
  "user_id": 45,
  "first_name": "John",
  "last_name": "Doe",
  "email": "john@example.com",
  "role": "loan_officer",
  "nmls_id": "123456",
  "job_title": "Senior Loan Officer",
  "phone": "555-1234",
  "company": "21st Century Lending",
  "bio": "Experienced loan officer...",
  "avatar_url": "https://...",
  "social": {
    "facebook": "https://facebook.com/johndoe",
    "linkedin": "https://linkedin.com/in/johndoe"
  },
  "meta": {
    "frs_department": "Sales",
    "frs_reports_to": 42
  }
}

Get Profile by User ID

GET /profiles/user/{user_id}

Example

bash
curl 'https://myhub21.com/wp-json/frs-users/v1/profiles/user/45'

Create Profile

POST /profiles

Body

json
{
  "user_id": 45,
  "first_name": "John",
  "last_name": "Doe",
  "email": "john@example.com",
  "role": "loan_officer",
  "nmls_id": "123456",
  "job_title": "Loan Officer",
  "phone": "555-1234"
}

Response

json
{
  "id": 124,
  "message": "Profile created successfully"
}

Update Profile

PUT /profiles/{id}

Body

json
{
  "job_title": "Senior Loan Officer",
  "phone": "555-5678"
}

Response

json
{
  "id": 123,
  "message": "Profile updated successfully"
}

Delete Profile

DELETE /profiles/{id}

Response

json
{
  "message": "Profile deleted successfully"
}

Profile Fields

Standard Fields

FieldTypeRequiredDescription
user_idintYesWordPress user ID
first_namestringYesFirst name
last_namestringYesLast name
emailstringYesEmail address
rolestringYesProfile role
nmls_idstringNoNMLS number
job_titlestringNoJob title
phonestringNoPhone number
companystringNoCompany name
biostringNoBiography

Social Fields

FieldTypeDescription
facebookstringFacebook URL
twitterstringTwitter URL
linkedinstringLinkedIn URL
instagramstringInstagram URL

Roles

RoleSlug
Loan Officerloan_officer
Realtor Partnerrealtor_partner
Staffstaff
Leadershipleadership
Assistantassistant

Error Codes

CodeStatusDescription
rest_forbidden403Insufficient permissions
rest_profile_not_found404Profile not found
rest_invalid_param400Invalid parameter

Hub21 Platform Documentation