Create Hub

This end point allows the user to quickly create hubs and assign them to the teams upon creation.

NameTypeDescription
addressobjectRequired. The hub’s street address information. The address data object fields are located under the Destination section.
teamarray of stringOptional. This is the team ID(s) that this Hub will be assigned to.
namestringRequired. A name to identify the Hub.
curl -X POST "https://onfleet.com/api/v2/hubs" \
       -u "cd3b3de84cc1ee040bf06512d233719c:" \
       -d '{"name": "VIP customer","address": {"apartment": "","state": "California","postalCode": "92806","number": "2695","street": "East Katella Avenue","city": "Anaheim","country": "United States","name": "VIP customer"},"teams": ["kq5MFBzYNWhp1rumJEfGUTqS"]}'
onfleet.destinations.create(body={
  "name": "VIP customer",
  "address": {
    "apartment": "",
    "state": "California",
    "postalCode": "92806",
    "number": "2695",
    "street": "East Katella Avenue",
    "city": "Anaheim",
    "country": "United States",
    "name": "VIP customer"
  },
  "teams": ["kq5MFBzYNWhp1rumJEfGUTqS"]
})
onfleet.hubs.create({"name": "VIP customer",
                     "address": {
                       "apartment": "",
                       "state": "California",
                       "postalCode": "92806",
                       "number": "2695",
                       "street": "East Katella Avenue",
                       "city": "Anaheim",
                       "country": "United States",
                       "name": "VIP customer"
                     },
                     "teams": ["kq5MFBzYNWhp1rumJEfGUTqS"]
                    });
$onfleet->hubs->create(["name"=>"VIP customer",
                        "address"=>["apartment" =>  "",
                                       "state" =>  "California",
                                       "postalCode" => "92806",
                                    "number" => "2695",
                                    "street" =>  "East Katella Avenue",
                                    "city" =>  "Anaheim",
                                    "country" =>  "United States",
                                    "name" =>  "VIP customer"
                                   ],
                        "teams" =>  ["kq5MFBzYNWhp1rumJEfGUTqS"]
                       ])
{
    "id": "i4FoP*dTVrdnGqvIVvvA69aB",
    "name": "VIP customer",
    "location": [
        -117.8767457,
        33.8079071
    ],
    "address": {
        "number": "2695",
        "street": "East Katella Avenue",
        "city": "Anaheim",
        "county": "Orange County",
        "state": "California",
        "country": "United States",
        "postalCode": "92806",
        "apartment": "",
        "name": "VIP customer"
    },
    "teams": [
        "kq5MFBzYNWhp1rumJEfGUTqS"
    ]
}