Draft the name and label a location create would store
const url = 'https://example.com/api/v1/locations:renderLabel';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"location_type":"example","name":"example","parent":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/locations:renderLabel \ --header 'Content-Type: application/json' \ --data '{ "location_type": "example", "name": "example", "parent": "example" }'The location tier of :renderLabel on components. Drafts the name and the label a location create would stamp, allocating nothing. A shipped fleet answers from the global location rule, which reads the location’s own name as words and titles it, so a location named north-wing drafts as North Wing; an empty label means no rule resolves at any tier, and the surface falls back to the name. Omitting name refuses (422) a location_type with no name rule, the same refusal a nameless create gives. Gated by location:create; the parent resolves within the caller’s location:create scope, because a location’s two placement buckets are under a parent or at the root and that is where the ordinal is read from. Omitting parent is the ROOT bucket, which a create refuses without an all-scoped grant, so the draft refuses it too (403) rather than reporting which names the fleet root already holds.
Request Body required
Section titled “Request Body required ”object
A URL to the JSON Schema for this object.
The location_type this location is classified by, by name or uuid
The name the row will carry. Omit it to draft the name and label the platform would produce, which a location_type with no name rule refuses; supply it to draft the label an operator-named location would carry.
The parent location, by name or uuid. A location has two placement buckets, under a parent or at the root, and this is which one a generated name’s ordinal is read from. Resolved within the caller’s location:create scope.
Responses
Section titled “ Responses ”OK
object
A URL to the JSON Schema for this object.
The label the create would store. Empty means no label is stored and the surface falls back to the name.
The name the create would stamp: the one you supplied, or the one the platform would mint. Generated names carry the ordinal that is free in the placement bucket right now.
The ordinal that name was minted from, absent when you supplied the name (an operator-named row carries no ordinal). Informational: what a form posts back as the create’s precondition is the NAME above, since that carries the stem and the suppression rule as well as this number.
The label rule that produced it, resolved through the same tiers the create uses. Empty means no tier carries a rule for this classification.
Example
{ "$schema": "/api/v1/schemas/DraftLabelOutputBody.json"}default
Section titled “default ”Error
object
A URL to the JSON Schema for this object.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
Example
{ "$schema": "/api/v1/schemas/ErrorModel.json", "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}