{"_id":"59778bb932f043002002f5da","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"},"user":"5425e31affd4411c319a65b1","project":"5425e663ffd4411c319a65b4","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-30T20:41:19.937Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"isReference":false,"order":12,"body":"Teams are named entities that bring together administrators and workers belonging to the same organization. Teams have hubs from where its workers may start and end their shifts.\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"Create team\"\n}\n[/block]\n\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\": \"workers\",\n    \"2-0\": \"managers\",\n    \"3-0\": \"hub\",\n    \"0-1\": \"string\",\n    \"1-1\": \"string array\",\n    \"2-1\": \"string array\",\n    \"3-1\": \"string\",\n    \"0-2\": \"A unique name for the team.\",\n    \"1-2\": \"An array of worker IDs.\",\n    \"2-2\": \"An array of managing administrator IDs.\",\n    \"3-2\": \"Optional. The ID of the team's hub.\"\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/teams\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\" \\\\\\n       -d '{\\\"name\\\":\\\"Sunset\\\",\\\"workers\\\":[\\\"1LjhGUWdxFbvdsTAAXs0TFos\\\",\\\"F8WPCqGmQYWpCkQ2c8zJTCpW\\\"],\\\"managers\\\":[\\\"Mrq7aKqzPFKX22pmjdLx*ohM\\\"],\\\"hub\\\":\\\"tKxSfU7psqDQEBVn5e2VQ~*O\\\"}'\",\n      \"language\": \"curl\",\n      \"name\": \"Shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"FFqPs1KHayxorfA~~xIj0us4\\\",\\n  \\\"timeCreated\\\": 1455156655000,\\n  \\\"timeLastModified\\\": 1455156655647,\\n  \\\"name\\\": \\\"Sunset\\\",\\n  \\\"workers\\\": [\\n    \\\"1LjhGUWdxFbvdsTAAXs0TFos\\\",\\n    \\\"F8WPCqGmQYWpCkQ2c8zJTCpW\\\"\\n  ],\\n  \\\"managers\\\": [\\n    \\\"Mrq7aKqzPFKX22pmjdLx*ohM\\\"\\n  ],\\n  \\\"hub\\\": \\\"tKxSfU7psqDQEBVn5e2VQ~*O\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"put\",\n  \"title\": \"Update team\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X PUT \\\"https://onfleet.com/api/v2/teams/FFqPs1KHayxorfA~~xIj0us4\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\" \\\\\\n       -d '{\\\"workers\\\":[\\\"1LjhGUWdxFbvdsTAAXs0TFos\\\",\\\"F8WPCqGmQYWpCkQ2c8zJTCpW\\\",\\\"3joS0Jh19VpJZgSTxFOK9fTf\\\"]}'\",\n      \"language\": \"shell\",\n      \"name\": \"Shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"FFqPs1KHayxorfA~~xIj0us4\\\",\\n  \\\"timeCreated\\\": 1455156655000,\\n  \\\"timeLastModified\\\": 1455156656399,\\n  \\\"name\\\": \\\"Sunset\\\",\\n  \\\"workers\\\": [\\n    \\\"1LjhGUWdxFbvdsTAAXs0TFos\\\",\\n    \\\"F8WPCqGmQYWpCkQ2c8zJTCpW\\\",\\n    \\\"3joS0Jh19VpJZgSTxFOK9fTf\\\"\\n  ],\\n  \\\"managers\\\": [\\n    \\\"Mrq7aKqzPFKX22pmjdLx*ohM\\\"\\n  ],\\n  \\\"hub\\\": \\\"tKxSfU7psqDQEBVn5e2VQ~*O\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"List teams\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X GET \\\"https://onfleet.com/api/v2/teams\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n  {\\n    \\\"id\\\": \\\"yKpCnWprM1Rvp3NGGlVa5TMa\\\",\\n    \\\"timeCreated\\\": 1455048584000,\\n    \\\"timeLastModified\\\": 1455049756016,\\n    \\\"name\\\": \\\"FiDi\\\",\\n    \\\"workers\\\": [\\n      \\\"1LjhGUWdxFbvdsTAAXs0TFos\\\"\\n    ],\\n    \\\"managers\\\": [\\n      \\\"Mrq7aKqzPFKX22pmjdLx*ohM\\\"\\n    ],\\n    \\\"hub\\\": null\\n  },\\n\\t// ...\\n  {\\n    \\\"id\\\": \\\"R4P7jhuzaIZ4cHHZE1ghmTtB\\\",\\n    \\\"timeCreated\\\": 1455048567000,\\n    \\\"timeLastModified\\\": 1455073711646,\\n    \\\"name\\\": \\\"Tenderloin\\\",\\n    \\\"workers\\\": [\\n      \\\"h*wSb*apKlDkUFnuLTtjPke7\\\",\\n      \\\"3joS0Jh19VpJZgSTxFOK9fTf\\\"\\n    ],\\n    \\\"managers\\\": [\\n      \\\"9ZGGl3R~T7lXxZOuOkZwuaPf\\\"\\n    ],\\n    \\\"hub\\\": \\\"E4s6bwGpOZp6pSU3Hz*2ngFA\\\"\\n  }\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Get single team\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X GET \\\"https://onfleet.com/api/v2/teams/9dyuPqHt6kDK5JKHFhE0xihh\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"id\\\": \\\"9dyuPqHt6kDK5JKHFhE0xihh\\\",\\n  \\\"timeCreated\\\": 1455048578000,\\n  \\\"timeLastModified\\\": 1455049756002,\\n  \\\"name\\\": \\\"Nob Hill\\\",\\n  \\\"workers\\\": [\\n    \\\"C**JneR4Jgd49ujNp7WsDE9Z\\\",\\n    \\\"1LjhGUWdxFbvdsTAAXs0TFos\\\"\\n  ],\\n  \\\"managers\\\": [\\n    \\\"9ZGGl3R~T7lXxZOuOkZwuaPf\\\"\\n  ],\\n  \\\"hub\\\": null,\\n  \\\"tasks\\\": []\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"delete\",\n  \"title\": \"Delete team\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -X DELETE \\\"https://onfleet.com/api/v2/teams/FFqPs1KHayxorfA~~xIj0us4\\\" \\\\\\n       -u \\\"cd3b3de84cc1ee040bf06512d233719c:\\\"\",\n      \"language\": \"shell\",\n      \"name\": \"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      \"name\": \"HTTP\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"teams","type":"basic","title":"Teams"}
Teams are named entities that bring together administrators and workers belonging to the same organization. Teams have hubs from where its workers may start and end their shifts. [block:api-header] { "type": "post", "title": "Create team" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "name", "1-0": "workers", "2-0": "managers", "3-0": "hub", "0-1": "string", "1-1": "string array", "2-1": "string array", "3-1": "string", "0-2": "A unique name for the team.", "1-2": "An array of worker IDs.", "2-2": "An array of managing administrator IDs.", "3-2": "Optional. The ID of the team's hub." }, "cols": 3, "rows": 4 } [/block] [block:code] { "codes": [ { "code": "$ curl -X POST \"https://onfleet.com/api/v2/teams\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\" \\\n -d '{\"name\":\"Sunset\",\"workers\":[\"1LjhGUWdxFbvdsTAAXs0TFos\",\"F8WPCqGmQYWpCkQ2c8zJTCpW\"],\"managers\":[\"Mrq7aKqzPFKX22pmjdLx*ohM\"],\"hub\":\"tKxSfU7psqDQEBVn5e2VQ~*O\"}'", "language": "curl", "name": "Shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"FFqPs1KHayxorfA~~xIj0us4\",\n \"timeCreated\": 1455156655000,\n \"timeLastModified\": 1455156655647,\n \"name\": \"Sunset\",\n \"workers\": [\n \"1LjhGUWdxFbvdsTAAXs0TFos\",\n \"F8WPCqGmQYWpCkQ2c8zJTCpW\"\n ],\n \"managers\": [\n \"Mrq7aKqzPFKX22pmjdLx*ohM\"\n ],\n \"hub\": \"tKxSfU7psqDQEBVn5e2VQ~*O\"\n}", "language": "json", "name": "JSON" } ] } [/block] [block:api-header] { "type": "put", "title": "Update team" } [/block] [block:code] { "codes": [ { "code": "$ curl -X PUT \"https://onfleet.com/api/v2/teams/FFqPs1KHayxorfA~~xIj0us4\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\" \\\n -d '{\"workers\":[\"1LjhGUWdxFbvdsTAAXs0TFos\",\"F8WPCqGmQYWpCkQ2c8zJTCpW\",\"3joS0Jh19VpJZgSTxFOK9fTf\"]}'", "language": "shell", "name": "Shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"FFqPs1KHayxorfA~~xIj0us4\",\n \"timeCreated\": 1455156655000,\n \"timeLastModified\": 1455156656399,\n \"name\": \"Sunset\",\n \"workers\": [\n \"1LjhGUWdxFbvdsTAAXs0TFos\",\n \"F8WPCqGmQYWpCkQ2c8zJTCpW\",\n \"3joS0Jh19VpJZgSTxFOK9fTf\"\n ],\n \"managers\": [\n \"Mrq7aKqzPFKX22pmjdLx*ohM\"\n ],\n \"hub\": \"tKxSfU7psqDQEBVn5e2VQ~*O\"\n}", "language": "json", "name": "JSON" } ] } [/block] [block:api-header] { "type": "get", "title": "List teams" } [/block] [block:code] { "codes": [ { "code": "$ curl -X GET \"https://onfleet.com/api/v2/teams\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"yKpCnWprM1Rvp3NGGlVa5TMa\",\n \"timeCreated\": 1455048584000,\n \"timeLastModified\": 1455049756016,\n \"name\": \"FiDi\",\n \"workers\": [\n \"1LjhGUWdxFbvdsTAAXs0TFos\"\n ],\n \"managers\": [\n \"Mrq7aKqzPFKX22pmjdLx*ohM\"\n ],\n \"hub\": null\n },\n\t// ...\n {\n \"id\": \"R4P7jhuzaIZ4cHHZE1ghmTtB\",\n \"timeCreated\": 1455048567000,\n \"timeLastModified\": 1455073711646,\n \"name\": \"Tenderloin\",\n \"workers\": [\n \"h*wSb*apKlDkUFnuLTtjPke7\",\n \"3joS0Jh19VpJZgSTxFOK9fTf\"\n ],\n \"managers\": [\n \"9ZGGl3R~T7lXxZOuOkZwuaPf\"\n ],\n \"hub\": \"E4s6bwGpOZp6pSU3Hz*2ngFA\"\n }\n]", "language": "json" } ] } [/block] [block:api-header] { "type": "get", "title": "Get single team" } [/block] [block:code] { "codes": [ { "code": "$ curl -X GET \"https://onfleet.com/api/v2/teams/9dyuPqHt6kDK5JKHFhE0xihh\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"id\": \"9dyuPqHt6kDK5JKHFhE0xihh\",\n \"timeCreated\": 1455048578000,\n \"timeLastModified\": 1455049756002,\n \"name\": \"Nob Hill\",\n \"workers\": [\n \"C**JneR4Jgd49ujNp7WsDE9Z\",\n \"1LjhGUWdxFbvdsTAAXs0TFos\"\n ],\n \"managers\": [\n \"9ZGGl3R~T7lXxZOuOkZwuaPf\"\n ],\n \"hub\": null,\n \"tasks\": []\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "delete", "title": "Delete team" } [/block] [block:code] { "codes": [ { "code": "$ curl -X DELETE \"https://onfleet.com/api/v2/teams/FFqPs1KHayxorfA~~xIj0us4\" \\\n -u \"cd3b3de84cc1ee040bf06512d233719c:\"", "language": "shell", "name": "Shell" } ] } [/block] [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK", "language": "http", "name": "HTTP" } ] } [/block]