User Profiles

The user profiles API allows you to manage related business data for users


The Profile Resource

Properties

  • Name
    user_id
    Required
    Type
    integer
    Description

    Unique identifier for the user who the profile belongs to

  • Name
    requires_review
    Required
    Type
    boolean
    Description

    Indicates that the profile requires a review or update because its either missing data or was last reviewed too long ago

  • Name
    position
    Required
    Type
    object
    Description
    • Name
      job_title
      Required
      Type
      string | null
      Description

      The users job title

    • Name
      customer_facing
      Required
      Type
      boolean | null
      Description

      Indicates that the user is in a customer facing role within their organisation

  • Name
    employer
    Required
    Type
    object
    Description
    • Name
      name
      Required
      Type
      string | null
      Description

      The users employer

    • Name
      branch
      Required
      Type
      string | null
      Description

      The employers branch location

  • Name
    dates
    Required
    Type
    object
    Description
    • Name
      dates.updated_at
      Required
      Type
      datetime
      Description

      The date the profile was last updated or reviewed, represented in YYYY-MM-DD HH:MM:SS format. If the profile has never been reviewed, this will be null.

Profile Resource

{
  "user_id": 1,
  "requires_review": false,
  "position": {
    "job_title": "Salesperson",
    "customer_facing": true
  },
  "employer": {
    "name": "ITC Compliance ltd",
    "branch": "Bristol",
  },
  "dates": {
    "updated_at": "2024-01-02 12:00:00",
  }
}

GET/v2/users/:user_id/profile

Retrieve Profile

Will retrieve a single profile by its user ID

URL Parameters

  • Name
    user_id
    Required
    required
    Type
    integer
    Description

    User ID of the profile to retrieve

Error Codes

Status Description
404 The requested user or profile could not be found.

Request

GET
/v2/users/:user_id/profile
use Compliance\Sdk\ApexV3\Contracts\ApexV3SdkInterface;
use Compliance\Sdk\Authentication\Types\Machine;

private ApexV3SdkInterface $sdk;

$response = $this->sdk
  ->v2(new Machine())
  ->user(1)
  ->profile()
  ->get();

Response

{
  "data": {
    "user_id": 1,
    "requires_review": false,
    "position": {
      "job_title": "Salesperson",
      "customer_facing": true
    },
    "employer": {
        "name": "ITC Compliance ltd",
        "branch": "Bristol",
    },
    "dates": {
      "updated_at": "2024-01-02 12:00:00",
    }
  }
}

PUT/v2/users/:user_id/profile

Update Profile

Will attempt to update the users profile.

Only values provided in the request payload will be updated.

URL Parameters

  • Name
    user_id
    Required
    required
    Type
    integer
    Description

    ID of the user to update the profile of

Payload

  • Name
    position
    Required
    Type
    object
    Description
    • Name
      job_title
      Required
      Type
      string | null
      Description

      The users job title

    • Name
      customer_facing
      Required
      Type
      boolean
      Description

      Whether the user is a customer facing role within their organisation

  • Name
    employer
    Required
    Type
    object
    Description
    • Name
      name
      Required
      Type
      string | null
      Description

      The users employer

    • Name
      branch
      Required
      Type
      string | null
      Description

      The employers branch location

Error Codes

Status Description
404 The requested user or profile could not be found.
422 The data provided in the payload was invalid. See errors for more details.

Request

PUT
/v2/users/:user_id/profile
use Compliance\Sdk\ApexV3\Contracts\ApexV3SdkInterface;
use Compliance\Sdk\Authentication\Types\Machine;

private ApexV3SdkInterface $sdk;

$response = $this->sdk
  ->v2(new Machine())
  ->user(1)
  ->profile()
  ->update([
    'position' => [
      'job_title' => 'Salesperson',
      'customer_facing' = true,
    ],
    'employer' => [
        'name' => 'ITC Compliance ltd',
        'branch' = 'Bristol',
    ]
  ]);

Response

{
  "data": {
    "user_id": 1,
    "requires_review": false,
    "position": {
      "job_title": "Salesperson",
      "customer_facing": true
    },
    "employer": {
        "name": "ITC Compliance ltd",
        "branch": "Bristol",
    },
    "dates": {
      "updated_at": "2024-01-02 12:00:00",
    }
  }
}