Locations
Upsert a location
PUT
/
location
/
{id}
Upsert a location
curl --request PUT \
--url https://{instance}/api/v2/location/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"metadata": {},
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"stateOrProvince": "<string>",
"postalCode": "<string>",
"latitude": 123,
"longitude": 123,
"timezone": "<string>",
"deliveryInstructions": "<string>",
"notes": "<string>"
}
'const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
shopId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
code: '<string>',
metadata: {},
addressLine1: '<string>',
addressLine2: '<string>',
city: '<string>',
stateOrProvince: '<string>',
postalCode: '<string>',
latitude: 123,
longitude: 123,
timezone: '<string>',
deliveryInstructions: '<string>',
notes: '<string>'
})
};
fetch('https://{instance}/api/v2/location/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/location/{id}"
payload = {
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"metadata": {},
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"stateOrProvince": "<string>",
"postalCode": "<string>",
"latitude": 123,
"longitude": 123,
"timezone": "<string>",
"deliveryInstructions": "<string>",
"notes": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"value": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"shopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>",
"type": "storage",
"metadata": {},
"isArchived": true,
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"stateOrProvince": "<string>",
"postalCode": "<string>",
"country": "US",
"latitude": 123,
"longitude": 123,
"timezone": "<string>",
"deliveryInstructions": "<string>",
"notes": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}Authorizations
Organization-scoped API key. Create one in the BuildingSwell app under Organization settings, API keys.
Path Parameters
Record id.
Query Parameters
Columns to overwrite when the row already exists. Repeat the parameter for each column: a single comma-separated value is read as one column name and fails at the database. Without the parameter the request is rejected with 400.
Body
application/json
Exactly one of shopId or projectId is required; coordinates must be supplied together.
Optional client-supplied ID.
Available options:
storage, staging, in_transit, yard, build_bay, station, rack, bay, booth, cell, shelf, zone, work_center, site Available options:
US, CA Response
Successful response.
Show child attributes
Show child attributes
⌘I
Upsert a location
curl --request PUT \
--url https://{instance}/api/v2/location/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"metadata": {},
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"stateOrProvince": "<string>",
"postalCode": "<string>",
"latitude": 123,
"longitude": 123,
"timezone": "<string>",
"deliveryInstructions": "<string>",
"notes": "<string>"
}
'const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
shopId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
code: '<string>',
metadata: {},
addressLine1: '<string>',
addressLine2: '<string>',
city: '<string>',
stateOrProvince: '<string>',
postalCode: '<string>',
latitude: 123,
longitude: 123,
timezone: '<string>',
deliveryInstructions: '<string>',
notes: '<string>'
})
};
fetch('https://{instance}/api/v2/location/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/location/{id}"
payload = {
"name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"shopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"metadata": {},
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"stateOrProvince": "<string>",
"postalCode": "<string>",
"latitude": 123,
"longitude": 123,
"timezone": "<string>",
"deliveryInstructions": "<string>",
"notes": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"value": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"shopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>",
"type": "storage",
"metadata": {},
"isArchived": true,
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"stateOrProvince": "<string>",
"postalCode": "<string>",
"country": "US",
"latitude": 123,
"longitude": 123,
"timezone": "<string>",
"deliveryInstructions": "<string>",
"notes": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}