People

The Person object

A Person object has the following properties:

  • id : string - The unique identifier of a person
  • username : string - The username of a person
  • email : string - The email address of a person

Create a person

Creates a new person.

POST /api/v2/person

Arguments:

  • name : string : The name of the new person
  • email : string : The email address of the new person
  • username : string : The username of the new person

Response object:

  • A newly-created Person object with the following properties:
    • id - string : The identifier of the person
    • name - string : The name of the person
    • email - string : The email address of the person
    • username - string : The username of the person
    • createdAt - timestamp : When the person was created
    • isLocked - boolean : Whether the person is locked

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    -X POST \
    "${JACKDB_API_URL}/person" \
    -d "name=Alice%20Smith&email=alice@example.org&username=alice"

Example response:

{
  "id": "PCukhIFFiNQaN19c",
  "name": "Alice Smith",
  "email": "alice@example.org",
  "username": "alice",
  "createdAt": "2015-03-22T16:35:27.376Z"
}

Delete a person

Permanently delete a person. The person must be locked prior to deletion.

DELETE /api/v2/person/:person

Arguments:

  • person - The identifier of the person whose permissions will be deleted

Response object:

This method returns an object with no properties.

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    -X DELETE \
    "${JACKDB_API_URL}/person/P0cKFCMIHoNaBFt7Y"

Example response:

{}

Delete all permissions granted to a person

Permanently deletes all permissions granted to a person.

DELETE /api/v2/person/:person/permission

Arguments:

  • person - The identifier of the person whose permissions will be revoked

Response object:

  • An object with the following properties:
    • count - integer : the number of deleted permissions

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    -X DELETE \
    "${JACKDB_API_URL}/person/P0cKFCMIHoNaBFt7Y/permission"

Example response:

{
  "count": 2
}

Disable two-factor authentication (2FA)

Disables a person's two-factor authentication (2FA).

DELETE /api/v2/person/:person/two-factor

Arguments:

  • person - The identifier of the person whose 2FA is to be disabled

Response object:

This method returns an object with no properties.

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    -X DELETE \
    "${JACKDB_API_URL}/person/P0GLBLsmDP7iqto7R/two-factor"

Example response:

{}

Note: This is an idempotent endpoint. Disabling two-factor authentication when it is already disabled will return a success response.

List all people

Returns a list of all people.

GET /api/v2/person

Arguments:

This method has no additional arguments.

Response object:

  • An array of Person objects
  • Each entry in the array is an object with the following properties:
    • id - string : The unique identifier of the person
    • name - string : The name of the person
    • username - string : The username of the person
    • email - string : The email address of the person
    • createdAt - timestamp : When the person was created
    • isLocked - boolean : Whether the person is locked

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/person"

Example response:

[
  {
    "id": "P0GLBLsmDP7iqto7R",
    "name": "Vaughn Rasmussen",
    "username": "vrasmussen",
    "email": "vaughn.rasmussen@example.com",
    "createdAt": "2014-09-01T21:46:02.539Z"
  },
  {
    "id": "P11TDFUc9rMeFgSyY",
    "name": "Emmy Armstrong",
    "username": "earmstrong",
    "email": "emmy.armstrong@example.com",
    "createdAt": "2014-08-27T01:11:36.077Z"
  },
  {
    "id": "P2227D20azrJ62nYE",
    "name": "Aurora Douglas",
    "username": "adouglas",
    "email": "aurora.douglas@example.com",
    "createdAt": "2014-09-03T06:14:34.593Z"
  }
]

List all data sources accessible to a person

Returns a list of all data sources accessible to a person.

GET /api/v2/person/:person/data-source

Arguments:

  • person - The identifier of the person whose data sources will be retrieved

Response object:

  • An array of Data Source objects
  • Each entry in the array is an object with the following properties:
    • id - string : The unique identifier of the data source
    • name - string : The name of the data source
    • alias - string : The alias of the data source

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/person/P0GLBLsmDP7iqto7R/data-source"

Example response:

[
  {
    "id": "DvZqlrLUHTE4G11L9",
    "name": "GL Production",
    "alias": "gl-prod"
  },
  {
    "id": "DFtlu8gfkiOSl0zf",
    "name": "GL Testing",
    "alias": "gl-uat"
  }
]

List all permissions granted to a person

Returns a list of all permissions granted to a person.

GET /api/v2/person/:person/permission

Arguments:

  • person - The identifier of the person whose permissions will be retrieved

Response object:

  • An array of Permission objects
  • Each entry in the array is an object with the following properties:
    • id - string : The unique identifier of the permission
    • personId - string : The unique identifier of the person granted this permission
    • dataSourceId - string : The unique identifier of the data source for this permission
    • expiresAt - timestamp : When the permission is set to expire

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/person/P0GLBLsmDP7iqto7R/permission"

Example response:

[
  {
    "id": "68939",
    "personId": "P0cKFCMIHoNaBFt7Y",
    "dataSourceId": "DUGC6IqGQ4DX00Lt0",
    "expiresAt": "2015-03-13T00:47:14.120Z"
  },
  {
    "id": "69303",
    "personId": "P0cKFCMIHoNaBFt7Y",
    "dataSourceId": "DUGC6IqGQ4DX00Lt0",
    "expiresAt": "2015-03-13T00:47:15.193Z"
  }
]

List all roles assigned to a person

Returns a list of all roles assigned to a person.

GET /api/v2/person/:person/role

Arguments:

  • person - The identifier of the person whose roles will be retrieved

Response object:

  • An array of Role objects
  • Each entry in the array is an object with the following properties:
    • id - string : The unique identifier of the role
    • name - string : The name of the role
    • assignedAt - timestamp : When the person was assigned to the role

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/person/P0GLBLsmDP7iqto7R/role"

Example response:

[
  {
    "id": "RHZ7pTXMCm3HrhG92",
    "name": "Finance",
    "assignedAt": "2014-09-04T16:20:09.138Z"
  },
  {
    "id": "RPJa0nipdJrG9kl6z",
    "name": "HR",
    "assignedAt": "2014-09-03T17:13:49.955Z"
  }
]

Lock a person

Locks a person.

PUT /api/v2/person/:person/lock

Arguments:

  • person - The identifier of the person to be locked

Response object:

This method returns an object with no properties.

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    -X PUT \
    "${JACKDB_API_URL}/person/P0GLBLsmDP7iqto7R/lock"

Example response:

{}

Note: This is an idempotent endpoint. Locking a person whose account is already locked will return a success response.

Retrieve a person

Retrieves the details of an existing person.

GET /api/v2/person/:person

Arguments:

  • person - The identifier of the person to be retrieved

Response object:

  • A Person object with the following properties:
    • id - string : The identifier of the person
    • name - string : The name of the person
    • username - string : The username of the person
    • email - string : The email address of the person
    • createdAt - timestamp : When the person was created
    • isLocked - boolean : Whether the person is locked

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/person/P0GLBLsmDP7iqto7R"

Example response:

{
  "id": "P0GLBLsmDP7iqto7R",
  "name": "Vaughn Rasmussen",
  "username": "vrasmussen",
  "email": "vaughn.rasmussen@example.com",
  "createdAt": "2014-09-01T21:46:02.539Z"
}

Unlock a person

Unlocks a person.

PUT /api/v2/person/:person/unlock

Arguments:

  • person - The identifier of the person to be unlocked

Response object:

This method returns an object with no properties.

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    -X PUT \
    "${JACKDB_API_URL}/person/P0GLBLsmDP7iqto7R/unlock"

Example response:

{}

Note: This is an idempotent endpoint. Unlocking a person whose account is already unlocked will return a success response.