> For the complete documentation index, see [llms.txt](https://docs.binity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.binity.io/locations.md).

# Locations

## Get Locations

<mark style="color:blue;">`GET`</mark> `https://api.binity.io/v1/companies/:uuid/locations`

Get all locations of that specific company.

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer Token |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
  "locations":[
    {
      "uuid":"f0634f09-e8d4-48dc-93ea-717aae9a47ca",
      "name":"Stuttgart",
      "lat":"48.76288512",
      "lng":"9.26070838",
      "street_name":"Am Mittelkai",
      "street_number":"23",
      "zip_code":"70327",
      "city":"Stuttgart",
      "state":"Baden-Württemberg",
      "country":"DE",
      "preformatted":"Am Mittelkai 23, 70327 Stuttgart, Germany",
      "created_at":"2020-06-08T10:16:16.508+02:00",
      "updated_at":"2021-03-16T06:56:42.764+01:00"
    }
  ],
  "meta":{
    "pagination":{
      "per_page":25,
      "total_pages":1,
      "total_objects":4,
      "links":{
        "first":"/v1/companies/f0634f09-e8d4-48dc-93ea-717aae9a47ca/locations?page=1",
        "last":"/v1/companies/f0634f09-e8d4-48dc-93ea-717aae9a47ca/locations?page=1"
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Create Location

<mark style="color:green;">`POST`</mark> `https://api.binity.io/v1/companies/:uuid/locations`

Create a new location for that company.

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer Token |

#### Request Body

| Name | Type   | Description             |
| ---- | ------ | ----------------------- |
| name | string | Name of the location    |
| lat  | string | Coordinates (Latitude)  |
| lng  | string | Coordinates (Longitude) |

{% tabs %}
{% tab title="200 " %}

```
{
  "location":{
    "uuid":"f0634f09-e8d4-48dc-93ea-717aae9a47ca",
    "name":"Stuttgart",
    "lat":"48.76288512",
    "lng":"9.26070838",
    "street_name":"Am Mittelkai",
    "street_number":"23",
    "zip_code":"70327",
    "city":"Stuttgart",
    "state":"Baden-Württemberg",
    "country":"DE",
    "preformatted":"Am Mittelkai 23, 70327 Stuttgart, Germany",
    "created_at":"2020-06-08T10:16:16.508+02:00",
    "updated_at":"2021-03-16T06:56:42.764+01:00"
  }
}
```

{% endtab %}
{% endtabs %}

## Get Location

<mark style="color:blue;">`GET`</mark> `https://api.binity.io/v1/companies/:uuid/locations/:location_uuid`

Get data of a single location.

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer Token |

{% tabs %}
{% tab title="200 " %}

```
{
  "location":{
    "uuid":"f0634f09-e8d4-48dc-93ea-717aae9a47ca",
    "name":"Stuttgart",
    "lat":"48.76288512",
    "lng":"9.26070838",
    "street_name":"Am Mittelkai",
    "street_number":"23",
    "zip_code":"70327",
    "city":"Stuttgart",
    "state":"Baden-Württemberg",
    "country":"DE",
    "preformatted":"Am Mittelkai 23, 70327 Stuttgart, Germany",
    "created_at":"2020-06-08T10:16:16.508+02:00",
    "updated_at":"2021-03-16T06:56:42.764+01:00"
  }
}
```

{% endtab %}
{% endtabs %}

## Update Location

<mark style="color:purple;">`PATCH`</mark> `https://api.binity.io/v1/companies/:uuid/locations/:location_uuid`

Update data of a single location.

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer Token |

{% tabs %}
{% tab title="200 " %}

```
{
  "location":{
    "uuid":"f0634f09-e8d4-48dc-93ea-717aae9a47ca",
    "name":"Stuttgart",
    "lat":"48.76288512",
    "lng":"9.26070838",
    "street_name":"Am Mittelkai",
    "street_number":"23",
    "zip_code":"70327",
    "city":"Stuttgart",
    "state":"Baden-Württemberg",
    "country":"DE",
    "preformatted":"Am Mittelkai 23, 70327 Stuttgart, Germany",
    "created_at":"2020-06-08T10:16:16.508+02:00",
    "updated_at":"2021-03-16T06:56:42.764+01:00"
  }
}
```

{% endtab %}
{% endtabs %}

## Delete Location

<mark style="color:red;">`DELETE`</mark> `https://api.binity.io/v1/companies/:uuid/locations/:location_uuid`

Delete a single location.

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer Token |

{% tabs %}
{% tab title="200 " %}

```
{
  "deleted": true
}
```

{% endtab %}
{% endtabs %}
