> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argyle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Activities

> Learn about the /activities endpoint.

Learn about the `/activities` endpoint.

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

![High level structure of the activity object.](https://res.cloudinary.com/argyle-media/image/upload/f_auto/v1674859074/docs-2023/API%20Endpoints/Activities)

## The activity object

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

### Attributes

* `id` (string (uuid), optional): Unique ID of the activity associated with a user's payroll account.
* `account` (string (uuid), optional): ID of the payroll account associated with the activity.
* `employer` (string, optional): The name of the company or entity that employs the user.
* `circumstances` (object, optional): Activity-specific data attributes (metadata) provided by the Link item.
* `duration` (integer, optional): Duration time for the activity, displayed in seconds.
* `earning_type` (note, optional)
* `income` (object, optional): Contains information about the amount earned for an activity.
* `start_location` (object, optional): Geographical information for activity's start location.
* `lat` (string, optional): The geographic latitude of where the activity started.
* `lng` (string, optional): The geographic longitude of where the activity started.
* `formatted_address` (string, optional): Full address of where the activity started.
* `end_location` (object, optional): Geographical information for activity's end location.
* `lat` (string, optional): The geographic latitude of where the activity ended.
* `lng` (string, optional): The geographic longitude of where the activity ended.
* `formatted_address` (string, optional): Full address of where the activity ended.
* `route` (string, optional): URL to the payroll provider page that contains the route of the activity.
* `distance` (string, optional): Distance traveled during the activity.
* `metadata` (object, optional): Holds additional available, often unstructured, information about this data resource.

```json theme={}

{
"id": "da332189-a115-484e-b60b-36ec2d5481d5",
"account": "9bb0ec90-03b1-4f8a-a72e-8f9f44a2f707",
"employer": "udre",
"link_item": "udre",
"created_at": "2022-10-20T15:54:07.360Z",
"updated_at": "2022-10-20T15:54:07.360Z",
"status": "completed",
"type": "rideshare",
"circumstances": {
"is_pool": false,
"is_rush": false,
"is_surge": false,
"service_type": "UdreX"
},
"num_tasks": 1,
"start_date": "2022-10-20T12:35:11Z",
"end_date": "2022-10-20T13:15:56Z",
"all_timestamps": {
"request_at": 1666269311,
"accept_at": 1666269315,
"pickup_at": 1666269776,
"dropoff_at": 1666271756,
"cancel_at": null,
"shift_start": null,
"shift_end": null,
"break_start": null,
"break_end": null,
"breaks": []
},
"all_datetimes": {
"request_at": "2022-10-20T12:35:11Z",
"accept_at": "2022-10-20T12:35:15Z",
"pickup_at": "2022-10-20T12:42:56Z",
"dropoff_at": "2022-10-20T13:15:56Z",
"cancel_at": null,
"shift_start": null,
"shift_end": null,
"break_start": null,
"break_end": null,
"breaks": []
},
"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": "56.75",
"mile": "8.32"
},
"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": {
"totalActualMileage": 25.95,
"totalPlannedMileage": 26.33
}
},
null,
2
  
```

<RefSubLayout.Divider />

## Retrieve an activity

**GET** `/v1/activities/{id}`

* Retrieve an activity object with the supplied ID.
* This request returns an activity object if a valid identifier was provided.

### Path parameters

* `id` (string (uuid), required): The identifier of the activity object to be retrieved.

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request GET \\
    --url https://api.argyle.com/v1/activities/{id} \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json'
      
    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/activities/{id}"
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.get(url, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

{
"id": "za332989-2315-48k1-b67y-36ec2d5481a1",
"account": "1ee3ec90-0431-4fqa-a56e-8f9k74a2f707",
"employer": "wellmart",
"link_item": "wellmart",
"created_at": "2020-04-01T14:13:47.804Z",
"updated_at": "2020-04-02T08:15:15.635Z",
"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": {
"request_at": null,
"accept_at": null,
"pickup_at": null,
"dropoff_at": null,
"cancel_at": null,
"shift_start": 1585728312,
"break_start": 1585744704,
"break_end": 1585746322,
"breaks": [
{
"break_start": 1585744704,
"break_end": 1585746322
},
{
"break_start": 1585744714,
"break_end": 1585746332
}
],
"shift_end": 1585760756
},
"all_datetimes": {
"request_at": null,
"accept_at": null,
"pickup_at": null,
"dropoff_at": null,
"cancel_at": null,
"shift_start": "2020-04-01T08:05:12Z",
"break_start": "2020-04-01T12:38:24Z",
"break_end": "2020-04-01T13:05:22Z",
"breaks": [
{
"break_start": "2020-04-01T12:38:24Z",
"break_end": "2020-04-01T13:05:22Z"
},
{
"break_start": "2020-04-01T15:22:13Z",
"break_end": "2020-04-01T15:51:59Z"
}
],
"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": {}
},
null,
2
  
```

<RefSubLayout.Divider />

## List activities

**GET** `/v1/activities`

* List all activities ordered by `start_date`. Filter them by date range, account, or user ID.
* This request returns an object with a `results` property that contains an array of up to `limit` activities objects.

### Query parameters

<Tabs>
  <Tab title="curl">
    ```bash theme={}
    curl --request GET \\
    --url https://api.argyle.com/v1/activities?limit=2 \\
    --header 'accept: application/json' \\
    --header 'content-type: application/json'
      
    ```
  </Tab>

  <Tab title="python">
    ```python theme={}
    import requests
    url = "https://api.argyle.com/v1/activities?limit=2"
    headers = {
    "accept": "application/json",
    "content-type": "application/json"
    }
    response = requests.get(url, headers=headers)
    ```
  </Tab>
</Tabs>

```json theme={}

[
  {
"id": "0180519e-6e3f-fcdc-27e8-802b2c098986",
"account": "0180519e-64f5-0107-603a-a460f85c2c50",
"employer": "amazin",
"link_item": "amazin",
"data_partner": "amazin",
"created_at": "2022-04-22T14:12:59.184Z",
"updated_at": "2022-04-22T14:12:59.184Z",
"status": "completed",
"type": "hourly",
"num_tasks": 1,
"start_date": "2022-04-21T14:12:58Z",
"end_date": "2022-04-21T22:12:58Z",
"all_timestamps": {
  "dropoff_at": null,
  "pickup_at": null,
  "request_at": null,
  "shift_start": 1650550378,
  "shift_end": 1650579178,
  "break_start": 1650563338,
  "break_end": 1650566218
},
"all_datetimes": {
  "dropoff_at": null,
  "pickup_at": null,
  "request_at": null,
  "shift_start": "2022-04-21T14:12:58Z",
  "shift_end": "2022-04-21T22:12:58Z",
  "break_start": "2022-04-21T17:48:58Z",
  "break_end": "2022-04-21T18:36:58Z"
},
"duration": 25920,
"timezone": "America/Los_Angeles",
"earning_type": "work",
"start_location": null,
"end_location": null,
"route": null,
"distance": null,
"distance_unit": null,
"complete_data_available": true,
"metadata": {},
"circumstances": {
  "is_pool": null,
  "is_rush": null,
  "is_surge": null,
  "service_type": null,
  "position": null
},
"income": {
  "currency": "USD",
  "total_charge": null,
  "fees": null,
  "total": "42.00",
  "pay": "42.00",
  "tips": null,
  "bonus": null,
  "taxes": null
},
"income_rates": {
  "hour": "6.00",
  "mile": null
}
  },
  {
"id": "018050e7-f9bb-5046-0e33-747c94ceb9fb",
"account": "018050e7-f083-eb25-1648-eb97aca69039",
"employer": "newtube",
"link_item": "newtube",
"data_partner": "newtube",
"created_at": "2022-04-22T10:53:41.790Z",
"updated_at": "2022-04-22T10:53:41.790Z",
"status": "completed",
"type": "hourly",
"num_tasks": 1,
"start_date": "2022-04-21T10:53:41Z",
"end_date": "2022-04-21T18:53:41Z",
"all_timestamps": {
  "dropoff_at": null,
  "pickup_at": null,
  "request_at": null,
  "shift_start": 1650538421,
  "shift_end": 1650567221,
  "break_start": 1650551381,
  "break_end": 1650554261
},
"all_datetimes": {
  "dropoff_at": null,
  "pickup_at": null,
  "request_at": null,
  "shift_start": "2022-04-21T10:53:41Z",
  "shift_end": "2022-04-21T18:53:41Z",
  "break_start": "2022-04-21T14:29:41Z",
  "break_end": "2022-04-21T15:17:41Z"
},
"duration": 25920,
"timezone": "America/Los_Angeles",
"earning_type": "work",
"start_location": null,
"end_location": null,
"route": null,
"distance": null,
"distance_unit": null,
"complete_data_available": true,
"metadata": {},
"circumstances": {
  "is_pool": null,
  "is_rush": null,
  "is_surge": null,
  "service_type": null,
  "position": null
},
"income": {
  "currency": "USD",
  "total_charge": null,
  "fees": null,
  "total": "238.00",
  "pay": "238.00",
  "tips": null,
  "bonus": null,
  "taxes": null
},
"income_rates": {
  "hour": "34.00",
  "mile": null
}
  }
],
null,
2
  
```
