Search

API information

The search endpoints allow you to query the audit log and activity feed data programmatically.

Search activity

Returns a list of data source activity

GET /api/v2/search/activity

Arguments:

  • createdAtStart - (Optional) Filters records created after the given timestamp.
  • createdAtEnd - (Optional) Filters records created before the given timestamp.
  • type - (Optional) Filters records matching the given event type.
  • actorIp - (Optional) Filters records matching the given IP address for the person that performed the action.
  • person - (Optional) Filters records matching the given unique identifier for the person.
  • dataSource - (Optional) Filters records matching the given unique identifier for the data source.
  • text - (Optional) Filters records matching the given text (case-sensitive).
  • itext - (Optional) Filters records matching the given text (not case-sensitive).

Response object:

  • An array of activity search objects with the following properties:
    • id - string : The unique identifier of the activity event
    • createdAt - timestamp : When the activity event was created
    • completedAt - timestamp : When the activity event was completed
    • success - boolean : Whether the activity event was successful
    • editorId - string : The unique identifier of the editor associated with the event
    • type - string : The activity event type
    • actorIp - string : The IP address of the person that performed the action
    • person - object : The Person object that performed the action
      • id - string : The unique identifier of the person
      • username - string : The username of the person
      • email - string : The email address of the person
    • dataSource - object : The Data Source object onto which this permission is granted
      • id - string : The unique identifier of the data source
      • name - string : The name of the data source
      • configUri - string : The config URI of the data source
    • detail - object : Additional event type-specific detail
    • results - array: An array of activity result objects generated by this event

For any given request, the first 500 records matching the filter criteria, if any, are retrieved, sorted by creation timestamp. Specify a createdAtStart filter to retrieve additional records beyond the first 500 for any given request.

Example requests:

Get all activity records:

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

Get activity records created after a given timestamp:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/search/activity?createdAtStart=2022-06-10T21:45:59.925Z"

Get activity records created within a timestamp range:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/search/activity?createdAtStart=2022-06-10T21:45:59.925Z&createdAtEnd=2022-07-10T12:30:09.925Z"

Get activity records filtered by a specific IP address:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/search/activity?actorIp=127.1.2.3"

Get activity records filtered by a specific person (by identifier):

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

Get activity records filtered by a specific person (by username):

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

Get activity records filtered by a specific data source (by identifier):

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/search/activity?dataSource=D38snndklsnf323yn"

Get activity records filtered by text within the record detail:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/search/activity?text=SELECT"

Search audit

Returns a list of audit log records

GET /api/v2/search/audit

Arguments:

  • createdAtStart - (Optional) Filters records created after the given timestamp.
  • createdAtEnd - (Optional) Filters records created before the given timestamp.
  • type - (Optional) Filters records matching the given event type.
  • actorIp - (Optional) Filters records matching the given IP address for the person that performed the action.
  • person - (Optional) Filters records matching the given unique identifier for the person.
  • text - (Optional) Filters records matching the given text (case-sensitive).
  • itext - (Optional) Filters records matching the given text (not case-sensitive).

Response object:

  • An array of audit log objects with the following properties:
    • id - string : The unique identifier of the audit event
    • createdAt - timestamp : When the audit event was generated
    • type - string : The audit event type
    • actorIp - string : The IP address of the person that generated the audit event
    • person - object : The Person object associated with the audit event
      • id - string : The unique identifier of the person
      • username - string : The username of the person
      • email - string : The email address of the person
    • accountApiKeyId - string : The API key that generated the audit event
    • detail - object : Additional event type-specific detail

For any given request, the first 500 records matching the filter criteria, if any, are retrieved, sorted by creation timestamp. Specify a createdAtStart filter to retrieve additional records beyond the first 500 for any given request.

Example requests:

Get all audit records:

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

Get audit records created after a given timestamp:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/search/audit?createdAtStart=2022-06-10T21:45:59.925Z"

Get audit records created within a timestamp range:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/search/audit?createdAtStart=2022-06-10T21:45:59.925Z&createdAtEnd=2022-07-10T12:30:09.925Z"

Get audit records filtered by a specific IP address:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/search/audit?actorIp=127.1.2.3"

Get audit records filtered by a specific person (by identifier):

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

Get audit records filtered by a specific person (by username):

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

Get audit records filtered by text within the record detail:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/search/audit?text=host"