{"_id":"59778bb932f043002002f5d9","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":"2016-01-13T00:44:52.934Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":11,"body":"A hub is a *depot* for a team: the location from where all deliveries start for the team's workers, for the purposes of [route optimization](http://support.onfleet.com/hc/en-us/articles/206578313-Optimize-Tasks) only; teams can have zero or one hubs.\n\nTo [create hubs](http://support.onfleet.com/hc/en-us/articles/206195753-Create-a-Hub), head over to the dashboard.\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"List hubs\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X GET \\\"https://onfleet.com/api/v2/hubs\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n  {\\n    \\\"id\\\": \\\"E4s6bwGpOZp6pSU3Hz*2ngFA\\\",\\n    \\\"name\\\": \\\"SF North\\\",\\n    \\\"location\\\": [\\n      -122.44002499999999,\\n      37.801826\\n    ],\\n    \\\"address\\\": {\\n      \\\"number\\\": \\\"3415\\\",\\n      \\\"street\\\": \\\"Pierce Street\\\",\\n      \\\"city\\\": \\\"San Francisco\\\",\\n      \\\"state\\\": \\\"California\\\",\\n      \\\"country\\\": \\\"United States\\\",\\n      \\\"postalCode\\\": \\\"94123\\\"\\n    }\\n  },\\n  {\\n    \\\"id\\\": \\\"tKxSfU7psqDQEBVn5e2VQ~*O\\\",\\n    \\\"name\\\": \\\"SF South\\\",\\n    \\\"location\\\": [\\n      -122.44337999999999,\\n      37.70883\\n    ],\\n    \\\"address\\\": {\\n      \\\"number\\\": \\\"335\\\",\\n      \\\"street\\\": \\\"Hanover Street\\\",\\n      \\\"city\\\": \\\"San Francisco\\\",\\n      \\\"state\\\": \\\"California\\\",\\n      \\\"country\\\": \\\"United States\\\",\\n      \\\"postalCode\\\": \\\"94112\\\"\\n    }\\n  }\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"hubs","type":"basic","title":"Hubs"}
A hub is a *depot* for a team: the location from where all deliveries start for the team's workers, for the purposes of [route optimization](http://support.onfleet.com/hc/en-us/articles/206578313-Optimize-Tasks) only; teams can have zero or one hubs. To [create hubs](http://support.onfleet.com/hc/en-us/articles/206195753-Create-a-Hub), head over to the dashboard. [block:api-header] { "type": "get", "title": "List hubs" } [/block] [block:code] { "codes": [ { "code": "$ curl -X GET \"https://onfleet.com/api/v2/hubs\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"E4s6bwGpOZp6pSU3Hz*2ngFA\",\n \"name\": \"SF North\",\n \"location\": [\n -122.44002499999999,\n 37.801826\n ],\n \"address\": {\n \"number\": \"3415\",\n \"street\": \"Pierce Street\",\n \"city\": \"San Francisco\",\n \"state\": \"California\",\n \"country\": \"United States\",\n \"postalCode\": \"94123\"\n }\n },\n {\n \"id\": \"tKxSfU7psqDQEBVn5e2VQ~*O\",\n \"name\": \"SF South\",\n \"location\": [\n -122.44337999999999,\n 37.70883\n ],\n \"address\": {\n \"number\": \"335\",\n \"street\": \"Hanover Street\",\n \"city\": \"San Francisco\",\n \"state\": \"California\",\n \"country\": \"United States\",\n \"postalCode\": \"94112\"\n }\n }\n]", "language": "json" } ] } [/block]