Activities

Learn about the /activities endpoint.

An activity is a single unit of work performed by a user at a company.

An activity object may represent a single task, as a shift, a job, or a batch of tasks depending on the company.

General attributes


id string uuid

Unique ID of the activity associated with a user's data partner account.


account string

ID of the account associated with the activity.


employer string

The name of the company or entity that employs the user.


link_item string

ID of the Link item (i.e. company or platform), that the user selected when connecting their account via Argyle Link. This value will oftentimes be human-readable.


status string

The current state of this activity.

Possible values: scheduled, in_progress, completed, cancelled.


type string

The type of activity that the worker undertook.

Possible values: delivery, rideshare, hourly, services.


circumstances object

Activity-specific data attributes (metadata) provided by the Link item.


num_tasks integer

The number of tasks performed. Will contain 1 if the activity object represents a single job (for example, a shift or trip). Will be 2 or more if the object represents an aggregate of tasks performed between start_datetime and end_datetime. It will contain null if the number of tasks performed is not known. This will be the case for companies that only provide aggregate data.


Duration attributes


start_date string

Timestamp representing the start of the activity. Timestamps follow the ISO 8601 standard.

If you view this timestamp in Console, it is displayed in your local timezone. If you call the /activities endpoint from the API to see this field, the timestamp is displayed in the UTC timezone.


end_date string

Timestamp representing the end of the activity. Timestamps follow the ISO 8601 standard.

If you view this timestamp in Console, it is displayed in your local timezone. If you call the /activities endpoint from the API to see this field, the timestamp is displayed in the UTC timezone.


all_timestamps object

The various timestamps of events inside of the activity. For example: shift_start, break_start, break_end, shift_end, pickup_at, dropoff_at, request_at.

Note that Argyle stores a single break_start and break_end value at any given time.

The formatting of all_timestamps can vary depending on the data partner. See all_datetimes below for values formatted according to the ISO 8601 standard.


all_datetimes object

Same attributes as in all_timestamps but all timestamps are converted to the ISO 8601 standard.


duration string decimal

Duration time for the activity displayed in seconds.


timezone string

The timezone of the activity. A list of possible time zone values is maintained at the IANA Time Zone Database.


Earnings attributes


earning_type string

The reason for specific earning. Not all earnings are due to activities. Some are just bonuses after the fact, some are incentives to work on peak hours, etc. Possible values:

  • offer - not yet completed earning, but a promise to get money when work is completed.
  • work - earning for completed work.
  • incentive - incentive to work odd hours, etc.
  • adjustment - additional earning after the work (for example, to meet minimum wage).
  • other - any other value that doesn't fit in the above (for example, might be a work-related product purchase provided to the user by the company that is subtracted from the user's earnings).

income object

An object that contains information about the amount earned for an activity.


income.currency string

Currency the income was received in—for example USD, EUR. Currencies follow the ISO 4217 format.


income.total_charge string decimal

The amount the company associated with the Link Item has charged for an activity (inclusive of any fees).

income.total_charge = income.fees + income.total


income.fees string decimal

Fees charged by the company associated with the Link Item (for example, Udre) for an activity assigned to the user.


income.total string decimal

Total amount received for this activity by a user: the sum of pay, tips, and bonus.


income.pay string decimal

The amount received for the job excluding tips, bonus, and fees.


income.tips string decimal

The amount of tips received for the activity.


income.bonus string decimal

The amount of bonus payment received for the activity.


income_rates object

This object will contain various rates as returned from the data partner. Rates can be per mile, minute or other unit.


Start Location attributes


start_location object

The geographical location of where the activity has started.


start_location.lat string decimal

The geographic latitude of where the activity started.


start_location.lng string decimal

The geographic longitude of where the activity started.


start_location.formatted_address string

Full address of where the activity started.


End Location attributes


end_location object

Location of where the activity has ended.


end_location.lat string decimal

The geographic latitude of where the activity ended.


end_location.lng string decimal

The geographic longitude of where the activity ended.


end_location.formatted_address string

Full address of where the activity ended.


Travel attributes


route string

URL to the data provider page that contains the route of the activity.


distance string decimal

Distance traveled during the activity.


distance_unit string

Distance measurement unit for the activity.

Possible options: miles; km.


metadata string

Metadata holds additional available, often unstructured, information about this data resource.


Endpoints

Endpoints

Retrieve an activity - GET /activities/:id

List activities - GET /activities

Example objects

{
   "id":"za332989-2315-48k1-b67y-36ec2d5481a1",
   "account":"1ee3ec90-0431-4fqa-a56e-8f9k74a2f707",
   "employer":"wellmart",
   "link_item":"wellmart",
   "created_at":"2020-04-01T14:13:47.804149Z",
   "updated_at":"2020-04-02T08:15:15.635636Z",
   "status":"completed",
   "type":"hourly",
   "circumstances":{
      "outside_of_prefered_hours":true
   },
   "num_tasks":1,
   "start_date":"2020-04-01T08:05:12Z",
   "end_date":"2020-04-01T17:05:56Z",
   "all_timestamps":{
      "shift_start":1585728312,
      "break_start":1585744704,
      "break_end":1585746322,
      "shift_end":1585760756
   },
   "all_datetimes":{
      "shift_start":"2020-04-01T08:05:12Z",
      "break_start":"2020-04-01T12:38:24Z",
      "break_end":"2020-04-01T13:05:22Z",
      "shift_end":"2020-04-01T17:05:56Z"
   },
   "duration":32444,
   "timezone":"America/Chicago",
   "earning_type":"work",
   "income":{
      "currency":"USD",
      "total_charge":null,
      "fees":null,
      "total":"180.00",
      "pay":"180.00",
      "tips":null,
      "bonus":null
   },
   "income_rates":{
      "hour":null,
      "mile":null
   },
   "start_location":null,
   "end_location":null,
   "route":null,
   "distance":null,
   "distance_unit":null,
   "metadata":{}
}
{
   "id":"da332189-a115-484e-b60b-36ec2d5481d5",
   "account":"9bb0ec90-03b1-4f8a-a72e-8f9f44a2f707",
   "employer":"udre",
   "link_item":"udre",
   "created_at":"2019-04-01T14:13:47.804149Z",
   "updated_at":"2019-04-02T08:15:15.635636Z",
   "status":"completed",
   "type":"rideshare",
   "circumstances":{
      "is_pool":false,
      "is_rush":false,
      "is_surge":false,
      "service_type":"UdreX"
   },
   "num_tasks":1,
   "start_date":"2019-04-01T12:38:24Z",
   "end_date":"2019-04-01T13:05:22Z",
   "all_timestamps":{
      "pickup_at":null,
      "dropoff_at":1590584722,
      "request_at":1590582737
   },
   "all_datetimes":{
      "pickup_at":null,
      "dropoff_at":"2020-05-27T13:05:22Z",
      "request_at":"2020-05-27T12:32:17Z"
   },
   "duration":1618,
   "timezone":"America/Chicago",
   "earning_type":"work",
   "income":{
      "currency":"USD",
      "total_charge":"18.27",
      "fees":"0.00",
      "total":"18.27",
      "pay":"18.27",
      "tips":"0.00",
      "bonus":"0.00"
   },
   "income_rates":{
      "hour":null,
      "mile":null
   },
   "start_location":{
      "lat":"42.58294677734375",
      "lng":"-77.70906829833984",
      "formatted_address":"10th St, Country Club Hills, IL 60478, USA"
   },
   "end_location":{
      "lat":"42.809085845947266",
      "lng":"-77.82435607910156",
      "formatted_address":"Clay Terrace, Lyons, IL 60534, USA"
   },
   "route":"https://partners.udre.com/p3/payments/trips/dde4c587-ffcf-4245-b414-781dcef483a1?in_app=true",
   "distance":"25.95",
   "distance_unit":"miles",
   "metadata":{}
}