{"_id":"59778bb932f043002002f5d8","category":{"_id":"59778bb932f043002002f5d5","version":"59778bb932f043002002f5d3","project":"5425e663ffd4411c319a65b4","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-09-29T20:18:57.785Z","from_sync":false,"order":1,"slug":"reference","title":"Reference"},"project":"5425e663ffd4411c319a65b4","user":"5425e31affd4411c319a65b1","version":{"_id":"59778bb932f043002002f5d3","project":"5425e663ffd4411c319a65b4","__v":1,"createdAt":"2017-07-25T18:19:37.272Z","releaseDate":"2017-07-25T18:19:37.272Z","categories":["59778bb932f043002002f5d4","59778bb932f043002002f5d5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.5.0","version":"2.5"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-09-30T01:47:32.241Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"isReference":false,"order":10,"body":"Workers (also known as *drivers* in the dashboard) are the members of an organization who perform actions via the Onfleet mobile applications. They may belong to teams managed by any number of administrators in their own organization. Workers have a vehicle with which tasks are completed.\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"Create worker\"\n}\n[/block]\nCreating a new worker generates a temporary password which is sent to the worker’s phone by SMS along with download details for the worker [iOS and Android mobile apps](http://support.onfleet.com/hc/en-us/sections/200863909-Driver-Mobile-App).\n\nThe worker will be able to set a permanent password when first logging in to the application.\n\nBody parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"name\",\n    \"1-0\": \"phone\",\n    \"2-0\": \"teams\",\n    \"3-0\": \"vehicle\",\n    \"0-1\": \"string\",\n    \"1-1\": \"string\",\n    \"2-1\": \"string array\",\n    \"3-1\": \"object\",\n    \"0-2\": \"The worker’s complete name.\",\n    \"1-2\": \"A valid phone number as per the worker’s organization’s country.\",\n    \"2-2\": \"One or more team IDs of which the worker is a member.\",\n    \"3-2\": \"Optional. The worker’s vehicle; providing no vehicle details is equivalent to the worker being on foot.\",\n    \"4-0\": \"capacity\",\n    \"4-1\": \"number\",\n    \"4-2\": \"Optional. The maximum number of units this worker can carry, for route optimization purposes.\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Note that a worker's image can only be set through the dashboard or by themselves on the mobile app.\",\n  \"title\": \"Worker Image\"\n}\n[/block]\nA `vehicle` has the following properties:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"type\",\n    \"0-1\": \"string\",\n    \"0-2\": \"The vehicle’s type, must be one of `CAR`, `MOTORCYCLE`, `BICYCLE` or `TRUCK`.\",\n    \"1-0\": \"description\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Optional. The vehicle’s make, model, year, or any other relevant identifying details.\",\n    \"2-0\": \"licensePlate\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Optional. The vehicle’s license plate number.\",\n    \"3-0\": \"color\",\n    \"3-1\": \"string\",\n    \"3-2\": \"Optional. The vehicle's color.\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X POST \\\"https://onfleet.com/api/v2/workers\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\" \\\\\\n       -d '{\\\"name\\\":\\\"A Swartz\\\",\\\"phone\\\":\\\"617-342-8853\\\",\\\"teams\\\":[\\\"nz1nG1Hpx9EHjQCJsT2VAs~o\\\"],\\\"vehicle\\\":{\\\"type\\\":\\\"CAR\\\",\\\"description\\\":\\\"Tesla Model 3\\\",\\\"licensePlate\\\":\\\"FKNS9A\\\",\\\"color\\\":\\\"purple\\\"}}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"sFtvhYK2l26zS0imptJJdC2q\\\",\\n  \\\"timeCreated\\\": 1455156653000,\\n  \\\"timeLastModified\\\": 1455156653214,\\n  \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n  \\\"name\\\": \\\"A Swartz\\\",\\n  \\\"phone\\\": \\\"+16173428853\\\",\\n  \\\"activeTask\\\": null,\\n  \\\"tasks\\\": [],\\n  \\\"onDuty\\\": false,\\n  \\\"timeLastSeen\\\": null,\\n  \\\"delayTime\\\": null,\\n  \\\"teams\\\": [\\n    \\\"nz1nG1Hpx9EHjQCJsT2VAs~o\\\"\\n  ],\\n  \\\"metadata\\\": [],\\n  \\\"vehicle\\\": {\\n    \\\"id\\\": \\\"tN1HjcvygQWvz5FRR1JAxwL8\\\",\\n    \\\"type\\\": \\\"CAR\\\",\\n    \\\"description\\\": \\\"Tesla Model 3\\\",\\n    \\\"licensePlate\\\": \\\"FKNS9A\\\",\\n    \\\"color\\\": \\\"purple\\\"\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n`delayTime` is a special property providing the amount of time in seconds that a worker is delayed by, based on the maximum `delayTime` of all assigned tasks, or `null` if the worker is not delayed. This is updated every minute if the worker is on-duty, or every 10 minutes if the worker is off-duty. To find out more about delayed statuses, see the `delayTime` part of our [Tasks](doc:tasks) section or check out [this support center entry](http://support.onfleet.com/hc/en-us/articles/204752505-Dashboard-statuses). `imageUrl` will also be provided if a worker image has been configured.\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"List workers\"\n}\n[/block]\nQuery parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"filter\",\n    \"0-1\": \"string\",\n    \"0-2\": \"Optional. A comma-separated list of fields to return, if all are not desired. For example, `name, location`.\",\n    \"2-0\": \"states\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Optional. A comma-separated list of worker states, where `0` is off-duty, `1` is idle (on-duty, no active task) and `2` is active (on-duty, active task).\",\n    \"1-0\": \"teams\",\n    \"1-1\": \"string\",\n    \"1-2\": \"Optional. A comma-separated list of the team IDs that workers must be part of.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X GET \\\"https://onfleet.com/api/v2/workers?states=1\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n  {\\n    \\\"id\\\": \\\"h*wSb*apKlDkUFnuLTtjPke7\\\",\\n    \\\"timeCreated\\\": 1455049674000,\\n    \\\"timeLastModified\\\": 1455156646529,\\n    \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n    \\\"name\\\": \\\"Andoni\\\",\\n    \\\"phone\\\": \\\"+14155558442\\\",\\n    \\\"activeTask\\\": null,\\n    \\\"tasks\\\": [\\n      \\\"11z1BbsQUZFHD1XAd~emDDeK\\\"\\n    ],\\n    \\\"onDuty\\\": true,\\n    \\\"timeLastSeen\\\": 1455156644323,\\n    \\\"delayTime\\\": null,\\n    \\\"teams\\\": [\\n      \\\"R4P7jhuzaIZ4cHHZE1ghmTtB\\\"\\n    ],\\n    \\\"metadata\\\": [\\n      {\\n        \\\"name\\\": \\\"nickname\\\",\\n        \\\"type\\\": \\\"string\\\",\\n        \\\"value\\\": \\\"Puffy\\\",\\n        \\\"visibility\\\": [\\n          \\\"api\\\"\\n        ]\\n      },\\n      {\\n        \\\"name\\\": \\\"otherDetails\\\",\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"value\\\": {\\n          \\\"availability\\\": {\\n            \\\"mon\\\": \\\"10:00\\\",\\n            \\\"sat\\\": \\\"16:20\\\",\\n            \\\"wed\\\": \\\"13:30\\\"\\n          },\\n          \\\"premiumInsurance\\\": false,\\n          \\\"trunkSize\\\": 9.5\\n        },\\n        \\\"visibility\\\": [\\n          \\\"api\\\"\\n        ]\\n      }\\n    ],\\n    \\\"location\\\": [\\n      -122.4015496466794,\\n      37.77629837661284\\n    ],\\n    \\\"vehicle\\\": null\\n  },\\n  {\\n    \\\"id\\\": \\\"1LjhGUWdxFbvdsTAAXs0TFos\\\",\\n    \\\"timeCreated\\\": 1455049755000,\\n    \\\"timeLastModified\\\": 1455072352267,\\n    \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n    \\\"name\\\": \\\"Yevgeny\\\",\\n    \\\"phone\\\": \\\"+14155552299\\\",\\n    \\\"activeTask\\\": null,\\n    \\\"tasks\\\": [\\n      \\\"*0tnJcly~vSI~9uHz*ICHXTw\\\",\\n      \\\"PauBfRH8gQCjtMLaPe97G8Jf\\\"\\n    ],\\n    \\\"onDuty\\\": true,\\n    \\\"timeLastSeen\\\": 1455156649007,\\n    \\\"delayTime\\\": null,\\n    \\\"teams\\\": [\\n      \\\"9dyuPqHt6kDK5JKHFhE0xihh\\\",\\n      \\\"yKpCnWprM1Rvp3NGGlVa5TMa\\\",\\n      \\\"fwflFNVvrK~4t0m5hKFIxBUl\\\"\\n    ],\\n    \\\"metadata\\\": [],\\n    \\\"location\\\": [\\n      -122.4016366,\\n      37.7764098\\n    ],\\n    \\\"vehicle\\\": {\\n      \\\"id\\\": \\\"ArBoHNxS4B76AiBKoIawY9OS\\\",\\n      \\\"type\\\": \\\"CAR\\\",\\n      \\\"description\\\": \\\"Lada Niva\\\",\\n      \\\"licensePlate\\\": \\\"23KJ129\\\",\\n      \\\"color\\\": \\\"Red\\\"\\n    }\\n  }\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get workers by location\"\n}\n[/block]\nYou may provide a coordinate pair along with a radius to get a list of workers who are currently within a certain target area.\n\nQuery parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"longitude\",\n    \"0-1\": \"number\",\n    \"0-2\": \"The longitude component of the coordinate pair.\",\n    \"1-0\": \"latitude\",\n    \"1-1\": \"number\",\n    \"1-2\": \"The latitude component of the coordinate pair.\",\n    \"2-0\": \"radius\",\n    \"2-1\": \"number\",\n    \"2-2\": \"Optional. The length in meters of the radius of the spherical area in which to look for workers. Defaults to 1000 if missing. Maximum value is 10000.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X GET \\\"https://onfleet.com/api/v2/workers/location?longitude=-122.41275787353516&latitude=37.78998061344339&radius=6000\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"workers\\\": [\\n    {\\n      \\\"id\\\": \\\"h*wSb*apKlDkUFnuLTtjPke7\\\",\\n      \\\"timeCreated\\\": 1458416497000,\\n      \\\"timeLastModified\\\": 1478383350446,\\n      \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n      \\\"name\\\": \\\"Andoni\\\",\\n      \\\"image\\\": null,\\n      \\\"phone\\\": \\\"+14155558442\\\",\\n      \\\"activeTask\\\": \\\"kc8SS1tzuZ~jqjlebKGrUmpe\\\",\\n      \\\"tasks\\\": [\\n        \\\"11z1BbsQUZFHD1XAd~emDDeK\\\",\\n        \\\"kc8SS1tzuZ~jqjlebKGrUmpe\\\"\\n      ],\\n      \\\"onDuty\\\": true,\\n      \\\"isResponding\\\": true,\\n      \\\"timeLastSeen\\\": 1480385504517,\\n      \\\"delayTime\\\": 1650,\\n      \\\"capacity\\\": 0,\\n      \\\"userData\\\": {},\\n      \\\"location\\\": [\\n        -122.4088934,\\n        37.7593079\\n      ],\\n      \\\"vehicle\\\": {\\n        \\\"id\\\": \\\"ArBoHNxS4B76AiBKoIawY9OS\\\",\\n        \\\"type\\\": \\\"CAR\\\",\\n        \\\"description\\\": \\\"Tesla Roadster\\\",\\n        \\\"licensePlate\\\": \\\"ELON4PREZ\\\",\\n        \\\"color\\\": \\\"black\\\",\\n        \\\"timeLastModified\\\": 1478383350431\\n      }\\n    },\\n    {\\n      \\\"id\\\": \\\"sFtvhYK2l26zS0imptJJdC2q\\\",\\n      \\\"timeCreated\\\": 1473361545000,\\n      \\\"timeLastModified\\\": 1480384608044,\\n      \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n      \\\"name\\\": \\\"Hitachino\\\",\\n      \\\"image\\\": null,\\n      \\\"phone\\\": \\\"+16175552820\\\",\\n      \\\"activeTask\\\": null,\\n      \\\"tasks\\\": [],\\n      \\\"onDuty\\\": true,\\n      \\\"isResponding\\\": true,\\n      \\\"timeLastSeen\\\": 1480385496759,\\n      \\\"delayTime\\\": null,\\n      \\\"capacity\\\": 0,\\n      \\\"userData\\\": {\\n        \\\"deviceDescription\\\": \\\"iPhone 6S (iOS 9.3.2)\\\",\\n        \\\"batteryLevel\\\": 0.43,\\n        \\\"appVersion\\\": \\\"0.9.65\\\",\\n        \\\"platform\\\": \\\"IOS\\\"\\n      },\\n      \\\"location\\\": [\\n        -122.4431349803903,\\n        37.75080475959717\\n      ],\\n      \\\"vehicle\\\": {\\n        \\\"id\\\": \\\"tN1HjcvygQWvz5FRR1JAxwL8\\\",\\n        \\\"type\\\": \\\"CAR\\\",\\n        \\\"description\\\": null,\\n        \\\"licensePlate\\\": null,\\n        \\\"color\\\": null,\\n        \\\"timeLastModified\\\": 1473361545335\\n      }\\n    },\\n    {\\n      \\\"id\\\": \\\"1LjhGUWdxFbvdsTAAXs0TFos\\\",\\n      \\\"timeCreated\\\": 1475782573000,\\n      \\\"timeLastModified\\\": 1480384815125,\\n      \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n      \\\"name\\\": \\\"Jack H.\\\",\\n      \\\"image\\\": null,\\n      \\\"phone\\\": \\\"+14155552299\\\",\\n      \\\"activeTask\\\": null,\\n      \\\"tasks\\\": [],\\n      \\\"onDuty\\\": true,\\n      \\\"isResponding\\\": true,\\n      \\\"timeLastSeen\\\": 1480385508283,\\n      \\\"delayTime\\\": null,\\n      \\\"capacity\\\": 0,\\n      \\\"userData\\\": {\\n        \\\"deviceDescription\\\": \\\"iPhone (iOS 10.0.1)\\\",\\n        \\\"batteryLevel\\\": 0.26,\\n        \\\"appVersion\\\": \\\"0.9.65\\\",\\n        \\\"platform\\\": \\\"IOS\\\"\\n      },\\n      \\\"location\\\": [\\n        -122.4161782737567,\\n        37.77294062828902\\n      ],\\n      \\\"vehicle\\\": null\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get single worker\"\n}\n[/block]\nBasic worker duty event, traveled distance (meters) and time analytics are optionally available by specifying the query parameter ```analytics``` as ```true```. \n\nYou may also provide both ```from``` and ```to``` timestamps as query parameters (up to a maximum duration of 24 hours) to target a specific time range. If you omit these parameters, the worker analytics for the last week will be provided.\n\nQuery parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"filter\",\n    \"0-1\": \"string array\",\n    \"0-2\": \"Optional. A comma-separated list of fields to return, if all are not desired. For example, `[ name, location ]`.\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X GET \\\"https://onfleet.com/api/v2/workers/1LjhGUWdxFbvdsTAAXs0TFos?analytics=true\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"1LjhGUWdxFbvdsTAAXs0TFos\\\",\\n  \\\"timeCreated\\\": 1455049755000,\\n  \\\"timeLastModified\\\": 1455072352267,\\n  \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n  \\\"name\\\": \\\"Yevgeny\\\",\\n  \\\"phone\\\": \\\"+14155552299\\\",\\n  \\\"activeTask\\\": null,\\n  \\\"tasks\\\": [\\n    \\\"*0tnJcly~vSI~9uHz*ICHXTw\\\",\\n    \\\"PauBfRH8gQCjtMLaPe97G8Jf\\\"\\n  ],\\n  \\\"onDuty\\\": true,\\n  \\\"timeLastSeen\\\": 1455156649007,\\n  \\\"delayTime\\\": null,\\n  \\\"teams\\\": [\\n    \\\"9dyuPqHt6kDK5JKHFhE0xihh\\\",\\n    \\\"yKpCnWprM1Rvp3NGGlVa5TMa\\\",\\n    \\\"fwflFNVvrK~4t0m5hKFIxBUl\\\"\\n  ],\\n  \\\"metadata\\\": [],\\n  \\\"location\\\": [\\n    -122.4016366,\\n    37.7764098\\n  ],\\n  \\\"vehicle\\\": {\\n    \\\"id\\\": \\\"ArBoHNxS4B76AiBKoIawY9OS\\\",\\n    \\\"type\\\": \\\"CAR\\\",\\n    \\\"description\\\": \\\"Lada Niva\\\",\\n    \\\"licensePlate\\\": \\\"23KJ129\\\",\\n    \\\"color\\\": \\\"Red\\\"\\n  },\\n  \\\"analytics\\\": {\\n    \\\"events\\\": [\\n      {\\n        \\\"action\\\": \\\"onduty\\\",\\n        \\\"time\\\": 1455072352164\\n      },\\n      {\\n        \\\"action\\\": \\\"offduty\\\",\\n        \\\"time\\\": 1455072485603\\n      }\\n    ],\\n    \\\"distances\\\": {\\n      \\\"enroute\\\": 0,\\n      \\\"idle\\\": 0\\n    },\\n    \\\"times\\\": {\\n      \\\"enroute\\\": 0,\\n      \\\"idle\\\": 132.18\\n    },\\n    \\\"taskCounts\\\": {\\n      \\\"succeeded\\\": 0,\\n      \\\"failed\\\": 0\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"put\",\n  \"title\": \"Update worker\"\n}\n[/block]\nNote that it is not possible to programmatically update a worker's `phone`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X PUT \\\"https://onfleet.com/api/v2/workers/sFtvhYK2l26zS0imptJJdC2q\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\" \\\\\\n       -d '{\\\"name\\\":\\\"Laura P\\\",\\\"teams\\\":[\\\"lHCUJFvh6v0YDURKjokZbvau\\\"]}'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"sFtvhYK2l26zS0imptJJdC2q\\\",\\n  \\\"timeCreated\\\": 1455156653000,\\n  \\\"timeLastModified\\\": 1455156654558,\\n  \\\"organization\\\": \\\"yAM*fDkztrT3gUcz9mNDgNOL\\\",\\n  \\\"name\\\": \\\"Laura P\\\",\\n  \\\"phone\\\": \\\"+16173428853\\\",\\n  \\\"activeTask\\\": null,\\n  \\\"tasks\\\": [],\\n  \\\"onDuty\\\": false,\\n  \\\"timeLastSeen\\\": null,\\n  \\\"delayTime\\\": null,\\n  \\\"teams\\\": [\\n    \\\"lHCUJFvh6v0YDURKjokZbvau\\\"\\n  ],\\n  \\\"metadata\\\": [],\\n  \\\"vehicle\\\": {\\n    \\\"id\\\": \\\"tN1HjcvygQWvz5FRR1JAxwL8\\\",\\n    \\\"type\\\": \\\"CAR\\\",\\n    \\\"description\\\": \\\"Tesla Model 3\\\",\\n    \\\"licensePlate\\\": \\\"FKNS9A\\\",\\n    \\\"color\\\": \\\"purple\\\"\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"delete\",\n  \"title\": \"Delete worker\"\n}\n[/block]\nNote that workers with an active task cannot be deleted until the task has been completed.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X DELETE \\\"https://onfleet.com/api/v2/workers/sFtvhYK2l26zS0imptJJdC2q\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 200 OK\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get worker's schedule\"\n}\n[/block]\nRetrieves all of the schedule entries for a worker.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl \\\"https://onfleet.com/api/v2/workers/GPOQQjU84QPN~fP*pbunT2CW/schedule\\\" -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"entries\\\":[\\n    {\\n      \\\"date\\\": \\\"2017-07-20\\\",\\n      \\\"shifts\\\": [[1500591600000,1500613200000]],\\n      \\\"timezone\\\": \\\"America/Los_Angeles\\\"\\n    },\\n      {\\n        \\\"date\\\": \\\"2017-07-17\\\",\\n        \\\"shifts\\\": [[1500307200000,1500314400000], [1500323100000,1500336000000]],\\n        \\\"timezone\\\": \\\"America/Los_Angeles\\\"\\n      }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"put\",\n  \"title\": \"Update worker's schedule\"\n}\n[/block]\nUses the provided list of entry objects to set the worker's schedule. Entries earlier than the start of the current week will not be saved. The structure of an entry list is as follows.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"date\",\n    \"0-1\": \"string\",\n    \"0-2\": \"A YYYY-MM-DD formatted date.\",\n    \"1-0\": \"timezone\",\n    \"1-1\": \"string\",\n    \"1-2\": \"A valid timezone.\",\n    \"2-0\": \"shifts\",\n    \"2-1\": \"array\",\n    \"2-2\": \"each element is a two element array which contains the start and end times of the shift as timestamps.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X POST \\\"https://onfleet.com/api/v2/workers/GPOQQjU84QPN~fP*pbunT2CW/schedule\\\" -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\" \\\\-d '\\n{\\n\\t\\\"entries\\\":[\\n  \\t{\\n    \\t\\\"date\\\":\\\"2017-07-16\\\",\\n    \\t\\\"shifts\\\":[[1500213600000,1500249600000]],\\n    \\t\\\"timezone\\\":\\\"America/Los_Angeles\\\"\\n    },\\n    {\\n    \\t\\\"date\\\":\\\"2017-07-20\\\",\\n      \\\"shifts\\\":[[1500591600000,1500613200000]],\\n      \\\"timezone\\\":\\\"America/Los_Angeles\\\"\\n     },\\n     {\\n     \\t\\t\\\"date\\\":\\\"2017-07-17\\\",\\n      \\t\\\"shifts\\\":[[1500307200000,1500314400000], [1500323100000,1500336000000]],\\n      \\t\\\"timezone\\\":\\\"America/Los_Angeles\\\"\\n      },\\n      {\\n      \\t\\t\\\"date\\\":\\\"2016-07-17\\\",\\n        \\t\\\"shifts\\\": [[1500307200000,1500314400000],[1500323100000,1500336000000]],\\n        \\t\\\"timezone\\\":\\\"America/Los_Angeles\\\"\\n      }\\n    ]\\n }'\\n\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nNotice that some entries were removed:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"entries\\\":[\\n    {\\n      \\\"date\\\": \\\"2017-07-20\\\",\\n      \\\"shifts\\\": [[1500591600000,1500613200000]],\\n      \\\"timezone\\\": \\\"America/Los_Angeles\\\"\\n    },\\n      {\\n        \\\"date\\\": \\\"2017-07-17\\\",\\n        \\\"shifts\\\": [[1500307200000,1500314400000], [1500323100000,1500336000000]],\\n        \\\"timezone\\\": \\\"America/Los_Angeles\\\"\\n      }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"workers","type":"basic","title":"Workers"}
Workers (also known as *drivers* in the dashboard) are the members of an organization who perform actions via the Onfleet mobile applications. They may belong to teams managed by any number of administrators in their own organization. Workers have a vehicle with which tasks are completed. [block:api-header] { "type": "post", "title": "Create worker" } [/block] Creating a new worker generates a temporary password which is sent to the worker’s phone by SMS along with download details for the worker [iOS and Android mobile apps](http://support.onfleet.com/hc/en-us/sections/200863909-Driver-Mobile-App). The worker will be able to set a permanent password when first logging in to the application. Body parameters [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "name", "1-0": "phone", "2-0": "teams", "3-0": "vehicle", "0-1": "string", "1-1": "string", "2-1": "string array", "3-1": "object", "0-2": "The worker’s complete name.", "1-2": "A valid phone number as per the worker’s organization’s country.", "2-2": "One or more team IDs of which the worker is a member.", "3-2": "Optional. The worker’s vehicle; providing no vehicle details is equivalent to the worker being on foot.", "4-0": "capacity", "4-1": "number", "4-2": "Optional. The maximum number of units this worker can carry, for route optimization purposes." }, "cols": 3, "rows": 5 } [/block] [block:callout] { "type": "info", "body": "Note that a worker's image can only be set through the dashboard or by themselves on the mobile app.", "title": "Worker Image" } [/block] A `vehicle` has the following properties: [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "type", "0-1": "string", "0-2": "The vehicle’s type, must be one of `CAR`, `MOTORCYCLE`, `BICYCLE` or `TRUCK`.", "1-0": "description", "1-1": "string", "1-2": "Optional. The vehicle’s make, model, year, or any other relevant identifying details.", "2-0": "licensePlate", "2-1": "string", "2-2": "Optional. The vehicle’s license plate number.", "3-0": "color", "3-1": "string", "3-2": "Optional. The vehicle's color." }, "cols": 3, "rows": 4 } [/block] [block:code] { "codes": [ { "code": "$ curl -X POST \"https://onfleet.com/api/v2/workers\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\" \\\n -d '{\"name\":\"A Swartz\",\"phone\":\"617-342-8853\",\"teams\":[\"nz1nG1Hpx9EHjQCJsT2VAs~o\"],\"vehicle\":{\"type\":\"CAR\",\"description\":\"Tesla Model 3\",\"licensePlate\":\"FKNS9A\",\"color\":\"purple\"}}'", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"sFtvhYK2l26zS0imptJJdC2q\",\n \"timeCreated\": 1455156653000,\n \"timeLastModified\": 1455156653214,\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"name\": \"A Swartz\",\n \"phone\": \"+16173428853\",\n \"activeTask\": null,\n \"tasks\": [],\n \"onDuty\": false,\n \"timeLastSeen\": null,\n \"delayTime\": null,\n \"teams\": [\n \"nz1nG1Hpx9EHjQCJsT2VAs~o\"\n ],\n \"metadata\": [],\n \"vehicle\": {\n \"id\": \"tN1HjcvygQWvz5FRR1JAxwL8\",\n \"type\": \"CAR\",\n \"description\": \"Tesla Model 3\",\n \"licensePlate\": \"FKNS9A\",\n \"color\": \"purple\"\n }\n}", "language": "json" } ] } [/block] `delayTime` is a special property providing the amount of time in seconds that a worker is delayed by, based on the maximum `delayTime` of all assigned tasks, or `null` if the worker is not delayed. This is updated every minute if the worker is on-duty, or every 10 minutes if the worker is off-duty. To find out more about delayed statuses, see the `delayTime` part of our [Tasks](doc:tasks) section or check out [this support center entry](http://support.onfleet.com/hc/en-us/articles/204752505-Dashboard-statuses). `imageUrl` will also be provided if a worker image has been configured. [block:api-header] { "type": "get", "title": "List workers" } [/block] Query parameters [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "filter", "0-1": "string", "0-2": "Optional. A comma-separated list of fields to return, if all are not desired. For example, `name, location`.", "2-0": "states", "2-1": "string", "2-2": "Optional. A comma-separated list of worker states, where `0` is off-duty, `1` is idle (on-duty, no active task) and `2` is active (on-duty, active task).", "1-0": "teams", "1-1": "string", "1-2": "Optional. A comma-separated list of the team IDs that workers must be part of." }, "cols": 3, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "$ curl -X GET \"https://onfleet.com/api/v2/workers?states=1\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"h*wSb*apKlDkUFnuLTtjPke7\",\n \"timeCreated\": 1455049674000,\n \"timeLastModified\": 1455156646529,\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"name\": \"Andoni\",\n \"phone\": \"+14155558442\",\n \"activeTask\": null,\n \"tasks\": [\n \"11z1BbsQUZFHD1XAd~emDDeK\"\n ],\n \"onDuty\": true,\n \"timeLastSeen\": 1455156644323,\n \"delayTime\": null,\n \"teams\": [\n \"R4P7jhuzaIZ4cHHZE1ghmTtB\"\n ],\n \"metadata\": [\n {\n \"name\": \"nickname\",\n \"type\": \"string\",\n \"value\": \"Puffy\",\n \"visibility\": [\n \"api\"\n ]\n },\n {\n \"name\": \"otherDetails\",\n \"type\": \"object\",\n \"value\": {\n \"availability\": {\n \"mon\": \"10:00\",\n \"sat\": \"16:20\",\n \"wed\": \"13:30\"\n },\n \"premiumInsurance\": false,\n \"trunkSize\": 9.5\n },\n \"visibility\": [\n \"api\"\n ]\n }\n ],\n \"location\": [\n -122.4015496466794,\n 37.77629837661284\n ],\n \"vehicle\": null\n },\n {\n \"id\": \"1LjhGUWdxFbvdsTAAXs0TFos\",\n \"timeCreated\": 1455049755000,\n \"timeLastModified\": 1455072352267,\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"name\": \"Yevgeny\",\n \"phone\": \"+14155552299\",\n \"activeTask\": null,\n \"tasks\": [\n \"*0tnJcly~vSI~9uHz*ICHXTw\",\n \"PauBfRH8gQCjtMLaPe97G8Jf\"\n ],\n \"onDuty\": true,\n \"timeLastSeen\": 1455156649007,\n \"delayTime\": null,\n \"teams\": [\n \"9dyuPqHt6kDK5JKHFhE0xihh\",\n \"yKpCnWprM1Rvp3NGGlVa5TMa\",\n \"fwflFNVvrK~4t0m5hKFIxBUl\"\n ],\n \"metadata\": [],\n \"location\": [\n -122.4016366,\n 37.7764098\n ],\n \"vehicle\": {\n \"id\": \"ArBoHNxS4B76AiBKoIawY9OS\",\n \"type\": \"CAR\",\n \"description\": \"Lada Niva\",\n \"licensePlate\": \"23KJ129\",\n \"color\": \"Red\"\n }\n }\n]", "language": "json" } ] } [/block] [block:api-header] { "type": "get", "title": "Get workers by location" } [/block] You may provide a coordinate pair along with a radius to get a list of workers who are currently within a certain target area. Query parameters [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "longitude", "0-1": "number", "0-2": "The longitude component of the coordinate pair.", "1-0": "latitude", "1-1": "number", "1-2": "The latitude component of the coordinate pair.", "2-0": "radius", "2-1": "number", "2-2": "Optional. The length in meters of the radius of the spherical area in which to look for workers. Defaults to 1000 if missing. Maximum value is 10000." }, "cols": 3, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "$ curl -X GET \"https://onfleet.com/api/v2/workers/location?longitude=-122.41275787353516&latitude=37.78998061344339&radius=6000\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"workers\": [\n {\n \"id\": \"h*wSb*apKlDkUFnuLTtjPke7\",\n \"timeCreated\": 1458416497000,\n \"timeLastModified\": 1478383350446,\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"name\": \"Andoni\",\n \"image\": null,\n \"phone\": \"+14155558442\",\n \"activeTask\": \"kc8SS1tzuZ~jqjlebKGrUmpe\",\n \"tasks\": [\n \"11z1BbsQUZFHD1XAd~emDDeK\",\n \"kc8SS1tzuZ~jqjlebKGrUmpe\"\n ],\n \"onDuty\": true,\n \"isResponding\": true,\n \"timeLastSeen\": 1480385504517,\n \"delayTime\": 1650,\n \"capacity\": 0,\n \"userData\": {},\n \"location\": [\n -122.4088934,\n 37.7593079\n ],\n \"vehicle\": {\n \"id\": \"ArBoHNxS4B76AiBKoIawY9OS\",\n \"type\": \"CAR\",\n \"description\": \"Tesla Roadster\",\n \"licensePlate\": \"ELON4PREZ\",\n \"color\": \"black\",\n \"timeLastModified\": 1478383350431\n }\n },\n {\n \"id\": \"sFtvhYK2l26zS0imptJJdC2q\",\n \"timeCreated\": 1473361545000,\n \"timeLastModified\": 1480384608044,\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"name\": \"Hitachino\",\n \"image\": null,\n \"phone\": \"+16175552820\",\n \"activeTask\": null,\n \"tasks\": [],\n \"onDuty\": true,\n \"isResponding\": true,\n \"timeLastSeen\": 1480385496759,\n \"delayTime\": null,\n \"capacity\": 0,\n \"userData\": {\n \"deviceDescription\": \"iPhone 6S (iOS 9.3.2)\",\n \"batteryLevel\": 0.43,\n \"appVersion\": \"0.9.65\",\n \"platform\": \"IOS\"\n },\n \"location\": [\n -122.4431349803903,\n 37.75080475959717\n ],\n \"vehicle\": {\n \"id\": \"tN1HjcvygQWvz5FRR1JAxwL8\",\n \"type\": \"CAR\",\n \"description\": null,\n \"licensePlate\": null,\n \"color\": null,\n \"timeLastModified\": 1473361545335\n }\n },\n {\n \"id\": \"1LjhGUWdxFbvdsTAAXs0TFos\",\n \"timeCreated\": 1475782573000,\n \"timeLastModified\": 1480384815125,\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"name\": \"Jack H.\",\n \"image\": null,\n \"phone\": \"+14155552299\",\n \"activeTask\": null,\n \"tasks\": [],\n \"onDuty\": true,\n \"isResponding\": true,\n \"timeLastSeen\": 1480385508283,\n \"delayTime\": null,\n \"capacity\": 0,\n \"userData\": {\n \"deviceDescription\": \"iPhone (iOS 10.0.1)\",\n \"batteryLevel\": 0.26,\n \"appVersion\": \"0.9.65\",\n \"platform\": \"IOS\"\n },\n \"location\": [\n -122.4161782737567,\n 37.77294062828902\n ],\n \"vehicle\": null\n }\n ]\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "get", "title": "Get single worker" } [/block] Basic worker duty event, traveled distance (meters) and time analytics are optionally available by specifying the query parameter ```analytics``` as ```true```. You may also provide both ```from``` and ```to``` timestamps as query parameters (up to a maximum duration of 24 hours) to target a specific time range. If you omit these parameters, the worker analytics for the last week will be provided. Query parameters [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "filter", "0-1": "string array", "0-2": "Optional. A comma-separated list of fields to return, if all are not desired. For example, `[ name, location ]`." }, "cols": 3, "rows": 1 } [/block] [block:code] { "codes": [ { "code": "$ curl -X GET \"https://onfleet.com/api/v2/workers/1LjhGUWdxFbvdsTAAXs0TFos?analytics=true\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"1LjhGUWdxFbvdsTAAXs0TFos\",\n \"timeCreated\": 1455049755000,\n \"timeLastModified\": 1455072352267,\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"name\": \"Yevgeny\",\n \"phone\": \"+14155552299\",\n \"activeTask\": null,\n \"tasks\": [\n \"*0tnJcly~vSI~9uHz*ICHXTw\",\n \"PauBfRH8gQCjtMLaPe97G8Jf\"\n ],\n \"onDuty\": true,\n \"timeLastSeen\": 1455156649007,\n \"delayTime\": null,\n \"teams\": [\n \"9dyuPqHt6kDK5JKHFhE0xihh\",\n \"yKpCnWprM1Rvp3NGGlVa5TMa\",\n \"fwflFNVvrK~4t0m5hKFIxBUl\"\n ],\n \"metadata\": [],\n \"location\": [\n -122.4016366,\n 37.7764098\n ],\n \"vehicle\": {\n \"id\": \"ArBoHNxS4B76AiBKoIawY9OS\",\n \"type\": \"CAR\",\n \"description\": \"Lada Niva\",\n \"licensePlate\": \"23KJ129\",\n \"color\": \"Red\"\n },\n \"analytics\": {\n \"events\": [\n {\n \"action\": \"onduty\",\n \"time\": 1455072352164\n },\n {\n \"action\": \"offduty\",\n \"time\": 1455072485603\n }\n ],\n \"distances\": {\n \"enroute\": 0,\n \"idle\": 0\n },\n \"times\": {\n \"enroute\": 0,\n \"idle\": 132.18\n },\n \"taskCounts\": {\n \"succeeded\": 0,\n \"failed\": 0\n }\n }\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "put", "title": "Update worker" } [/block] Note that it is not possible to programmatically update a worker's `phone`. [block:code] { "codes": [ { "code": "$ curl -X PUT \"https://onfleet.com/api/v2/workers/sFtvhYK2l26zS0imptJJdC2q\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\" \\\n -d '{\"name\":\"Laura P\",\"teams\":[\"lHCUJFvh6v0YDURKjokZbvau\"]}'", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"sFtvhYK2l26zS0imptJJdC2q\",\n \"timeCreated\": 1455156653000,\n \"timeLastModified\": 1455156654558,\n \"organization\": \"yAM*fDkztrT3gUcz9mNDgNOL\",\n \"name\": \"Laura P\",\n \"phone\": \"+16173428853\",\n \"activeTask\": null,\n \"tasks\": [],\n \"onDuty\": false,\n \"timeLastSeen\": null,\n \"delayTime\": null,\n \"teams\": [\n \"lHCUJFvh6v0YDURKjokZbvau\"\n ],\n \"metadata\": [],\n \"vehicle\": {\n \"id\": \"tN1HjcvygQWvz5FRR1JAxwL8\",\n \"type\": \"CAR\",\n \"description\": \"Tesla Model 3\",\n \"licensePlate\": \"FKNS9A\",\n \"color\": \"purple\"\n }\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "delete", "title": "Delete worker" } [/block] Note that workers with an active task cannot be deleted until the task has been completed. [block:code] { "codes": [ { "code": "$ curl -X DELETE \"https://onfleet.com/api/v2/workers/sFtvhYK2l26zS0imptJJdC2q\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK", "language": "http" } ] } [/block] [block:api-header] { "type": "get", "title": "Get worker's schedule" } [/block] Retrieves all of the schedule entries for a worker. [block:code] { "codes": [ { "code": "$ curl \"https://onfleet.com/api/v2/workers/GPOQQjU84QPN~fP*pbunT2CW/schedule\" -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"entries\":[\n {\n \"date\": \"2017-07-20\",\n \"shifts\": [[1500591600000,1500613200000]],\n \"timezone\": \"America/Los_Angeles\"\n },\n {\n \"date\": \"2017-07-17\",\n \"shifts\": [[1500307200000,1500314400000], [1500323100000,1500336000000]],\n \"timezone\": \"America/Los_Angeles\"\n }\n ]\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "put", "title": "Update worker's schedule" } [/block] Uses the provided list of entry objects to set the worker's schedule. Entries earlier than the start of the current week will not be saved. The structure of an entry list is as follows. [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "date", "0-1": "string", "0-2": "A YYYY-MM-DD formatted date.", "1-0": "timezone", "1-1": "string", "1-2": "A valid timezone.", "2-0": "shifts", "2-1": "array", "2-2": "each element is a two element array which contains the start and end times of the shift as timestamps." }, "cols": 3, "rows": 3 } [/block] [block:code] { "codes": [ { "code": "$ curl -X POST \"https://onfleet.com/api/v2/workers/GPOQQjU84QPN~fP*pbunT2CW/schedule\" -u \"cd3b3de84cc1ee040bf06512d233719c:\" \\-d '\n{\n\t\"entries\":[\n \t{\n \t\"date\":\"2017-07-16\",\n \t\"shifts\":[[1500213600000,1500249600000]],\n \t\"timezone\":\"America/Los_Angeles\"\n },\n {\n \t\"date\":\"2017-07-20\",\n \"shifts\":[[1500591600000,1500613200000]],\n \"timezone\":\"America/Los_Angeles\"\n },\n {\n \t\t\"date\":\"2017-07-17\",\n \t\"shifts\":[[1500307200000,1500314400000], [1500323100000,1500336000000]],\n \t\"timezone\":\"America/Los_Angeles\"\n },\n {\n \t\t\"date\":\"2016-07-17\",\n \t\"shifts\": [[1500307200000,1500314400000],[1500323100000,1500336000000]],\n \t\"timezone\":\"America/Los_Angeles\"\n }\n ]\n }'\n", "language": "shell" } ] } [/block] Notice that some entries were removed: [block:code] { "codes": [ { "code": "{\n \"entries\":[\n {\n \"date\": \"2017-07-20\",\n \"shifts\": [[1500591600000,1500613200000]],\n \"timezone\": \"America/Los_Angeles\"\n },\n {\n \"date\": \"2017-07-17\",\n \"shifts\": [[1500307200000,1500314400000], [1500323100000,1500336000000]],\n \"timezone\": \"America/Los_Angeles\"\n }\n ]\n}", "language": "json" } ] } [/block]