Managing Users

Users for your app are primarily created using the Human Connect flow. Once you have users you can manage them with either the Developer Portal or the Application API.

Both methods are described in detail below.

Managing Users via the Developer Portal

One way to manage users is via the Developer Portal. From your app homepage, click the 'Users' section to see a list of your app's users.

1392

From this page, you can see the humanId, ExternalId, accessToken, and publicToken for a user.

Under the Options column, you can do two things:

  • See or connect data sources for a user (blue bar icon)
  • Delete that user (red X icon)

Managing User Data Sources

By clicking on the user's humanId, you will be able to see what data sources that user has connected. Additionally, there will be a Human Connect button preconfigured for the specific user to allow you to connect directly in the Developer Portal.

1392

Viewing User Data

By clicking any of the available data sources for a user, you can also view a graphic representation of the current data.

1392

Manage Users via the Application API

Another way to manage users is via the Application API's /users endpoint:

https://api.humanapi.co/v1/apps/{clientId}/users

Retrieve a Single User

You can retrieve a single app user by using this URL:

https://api.humanapi.co/v1/apps/{clientId}/users/{humanId}

Replace the {clientId} with the Client ID for your application, and {humanId} with the assigned Id for the specific user.

Using curl command line:

# Get a single user associated with an app
curl -X GET -H 'Accept: application/json' -u e7db255f4828e1d482743eba04faacb945ab7ca8: https://api.humanapi.co/v1/apps/1d129c20acf6fcef9be0b067cc7859d872ed5ade/users/0a34dca6b9fe0b2361038bd371d96539

Example User Payload

{
  "humanId": "0a34dca6b9fe0b2361038bd371d96539",
  "externalId": "[email protected]",
  "appId": "1d129c20acf6fcef9be0b067cc7859d872ed5ade",
  "createdAt": "2013-12-28T18:46:10.436Z",
  "updatedAt": "2013-12-29T05:05:50.601Z"
}

📘

appId == clientId

The returned payload will return the attribute "appId". appId is equivalent to clientId and is a prior naming convention that will be changed in the next major API release.

Retrieve All Users

To retrieve all users, you can just query the /users endpoint itself:

# Get all users associated with an app
curl -X GET -H 'Accept: application/json' -u e7db255f4828e1d482743eba04faacb945ab7ca8: https://api.humanapi.co/v1/apps/1d129c20acf6fcef9be0b067cc7859d872ed5ade/users

Delete a User

You can delete a user by using this URL:

https://api.humanapi.co/v1/apps/{clientId}/users/{humanId}

Replace the {clientId} with the Client ID for your application, and {humanId} with the assigned Id.

Example

# Delete a user
curl -X DELETE -u 1cf3900bd3968ab34344c9318342f6c3ca1456d3: https://api.humanapi.co/v1/apps/1479b39aa3476f92d7569485e3b3f6f773642ef/users/2242b2440ef1aab43719f202af316a2a

The response code for this is 204

🚧

It is only recommended that you only delete a user when that user account is also deleted on your system. This will avoid potential Connect errors later on.