# Add location to a tag

```http
POST https://api.synup.com/api/v4/locations/tags
```

This API associates a location with a specified tag. If the tag does not exist, it will be automatically created before the association.

**Behavior:**
- Can be used to create new tags and assign existing tags to locations.
- Each location can have a maximum of 10 tags. Exceeding this limit will result in an error.

Source: https://developer.synup.com/api/organizing-locations/add-location-to-a-tag

## Request body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `input` | object | required |  |
| `input.locationId` | string | required | Unique identifier of the location |
| `input.tag` | string | required | Name of the tag to add the location to |

## Example request

```bash
curl -X POST 'https://api.synup.com/api/v4/locations/tags' \
  -H 'Authorization: API YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '""'
```

## Responses

| Status | Description |
| --- | --- |
| `200` | Operation result |
| `400` | Bad request - Invalid location ID or tag name |
| `401` | Unauthorized - Authentication required |
| `403` | Forbidden - Insufficient permissions |
| `404` | Location not found |
