POSTapi.synup.com/api/v4/locations/tags
Add location to a tag
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.
Requires an API key. Send it as
Authorization: API <your-key> — see Getting started.Parameters
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 |
Request
Request
curl -X POST 'https://api.synup.com/api/v4/locations/tags' \
-H 'Authorization: API YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '""'const res = await fetch('https://api.synup.com/api/v4/locations/tags', {
method: 'POST',
headers: {
Authorization: 'API YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify(""),
});
const data = await res.json();import requests
res = requests.post(
"https://api.synup.com/api/v4/locations/tags",
headers={
"Authorization": "API YOUR_API_KEY",
"Content-Type": "application/json",
},
json="",
)
data = res.json()req, _ := http.NewRequest("POST", "https://api.synup.com/api/v4/locations/tags", bytes.NewBufferString(payload))
req.Header.Set("Authorization", "API YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)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 |
Example response (generated from the schema)
{
"data": {
"addTag": {
"clientMutationId": "string",
"errors": [
{
"code": "SY10040",
"message": "string",
"contextInfo": [
"string"
]
}
],
"success": true,
"tag": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string"
}
}
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | optional | |
data.addTag | object | optional | |
data.addTag.clientMutationId | object | optional | Optional client-provided mutation identifier |
data.addTag.errors | array of object | optional | Array of errors if any occurred |
data.addTag.errors[].code | string | optional | Error code |
data.addTag.errors[].message | string | optional | Human-readable error message |
data.addTag.errors[].contextInfo | array of string | optional | Additional context about the error |
data.addTag.success | boolean | optional | Indicates if the operation was successful |
data.addTag.tag | object | optional | Details of the created/existing tag |
data.addTag.tag.id | string | optional | Unique identifier of the tag |
data.addTag.tag.name | string | optional | Name of the tag |