Users

Learn about the /users and /user-tokens endpoints.

The user object

User objects represent distinct users that have connected their payroll accounts via Argyle Link.

You can list all users or retrieve a user by ID that you have saved in your database when one of the Argyle Link callbacks was invoked.

Attributes

AttributeTypeDescription
idstring uuidUnique ID of the user.
created_atstringTime at which the user was created. Timestamps follow the ISO 8601 standard.
employers_connectedarray of stringsA list of names of employers that the user has connected to via Argyle Link. This list might be different from data_providers_connected, which can include payroll providers that service multiple employers (for example, MyADP). The connections might be active or previously connected employers, which are no longer active (for example, due to a user switching jobs).

This field is populated after the initial scan is completed and the account is connected successfully, so there is a short (a few seconds) delay before you can see the list. Use the employments webhook to know when this data is available on the platform.
data_providers_connectedarray of stringsA list of the IDs of Link items that the user has connected. The connections might be active or previously connected Link items, which are no longer active (for example, due to a user switching jobs). This field is populated immediately after user creation.
external_metadataYou can set external metadata when creating or updating a user. This external metadata can be used to map users between Argyle and your own database.

External metadata can be any valid JSON, such as a string or an object.

Grouping users


You can use the external_metadata field to classify users into categories as needed. We also recommend adding your internal user id's in external_metadata for easier tracking.

When creating a user, include the metadata information as a body parameter:

{
    "external_metadata": {
        "internalTracking_userId": "1324",
        "internalTracking_groupClassification": "Gig Worker"
    }
}

At any time, you can retrieve a user's metadata or update a user's metadata.

Endpoints


These are the endpoints available for users.

Endpoints
Create a user - POST /users
Retrieve a user and their metadata - GET /users/:id
Update a user's metadata - PATCH /users/:id
List users - GET /users
Delete a user - DELETE /users/:id
Create a user token - POST /user-tokens

Example object

{
    "id": "0994b847-cc69-4d98-bc99-c5e65e762add",
    "created_at": "2019-11-27T15:56:50.583233Z",
    "employers_connected": [
        "homedepot",
        "uber"
    ],
    "data_providers_connected": [
        "workday",
        "uber"
    ],
    "external_metadata": "User group A"
}

User tokens

User tokens are temporary access keys that ensure a user's permissions in Argyle Link are scoped to that specific user's data. Argyle uses JWT tokens with a short-lived expiry.

User tokens are explained in-depth in our returning user experience guide.

Endpoints

These are the endpoints available for user-tokens.

Endpoints
Create a user token - POST /user-tokens