Update a location
PATCH
/locations/{id}
const url = 'https://app.buildtrace.eu/api/locations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"code":"example","name":"example","kind":"example","notes":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://app.buildtrace.eu/api/locations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "code": "example", "name": "example", "kind": "example", "notes": "example" }'Edit a location’s name, kind and notes. The code can change only while nothing refers to the location yet (no stock, units, movements or build orders); after that it is fixed, so history and labels keep reading the same. Omitted fields are left as they are; an empty notes clears it.
Required scope: inventory:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
Only while nothing refers to the location yet.
string
name
string
kind
string
notes
An empty string clears the notes.
string
Example generated
{ "code": "example", "name": "example", "kind": "example", "notes": "example"}Responses
Section titled “Responses”Updated
Media typeapplication/json
object
id
required
string format: uuid
code
required
string
name
required
string
kind
required
string
notes
string
isActive
required
boolean
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "code": "example", "name": "example", "kind": "example", "notes": "example", "isActive": true}Invalid (blank name or code, unknown kind)
Media typeapplication/json
object
error
required
string
Example generated
{ "error": "example"}Unauthorized
Not found
The code is taken by another location, or the location is in use and its code is fixed
Media typeapplication/json
object
error
required
string
Example generated
{ "error": "example"}