Set a building's gross area (square feet), asynchronously
Audience: org-service-account
Starts a background job (a batch of one) and returns immediately. Poll the returned statusUrl (also the Location header); the result of the update, including a building that is not found, is its item. Idempotent; setting the same value twice is harmless.
Request
PUT https://api.mapped.com/v1/accounts/{accountId}/orgs/{orgId}/buildings/{buildingId}/gross-area
Parameters
| Name | In | Required | Type | Constraints | Description |
|---|---|---|---|---|---|
accountId | path | yes | string | ||
orgId | path | yes | string | ||
buildingId | path | yes | string | pattern ^[A-Za-z0-9_.-]{1,128}$ |
Request body
The request body is required.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
grossArea | number | yes | minimum 0 | Square feet. 0 is valid. |
createConnector | boolean | no | default false | Allow creating the admin-center connector if the org has none. |
Example
curl -X PUT 'https://api.mapped.com/v1/accounts/{accountId}/orgs/{orgId}/buildings/{buildingId}/gross-area' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"grossArea":52000}'
Responses
202
Starts a background job (a batch of one) and returns immediately. Poll the returned statusUrl (also the Location header); the result of the update, including a building that is not found, is its item. Idempotent; setting the same value twice is harmless.
See the example above.
400
Nothing was started: grossArea is missing, not a number, or below 0 (invalid_gross_area); createConnector is not a boolean (invalid_create_connector); buildingId does not match the pattern (invalid_building_id); or the body is not a JSON object, is malformed, or is not application/json (bad_request).
Example error code: invalid_gross_area
{
"code": "invalid_gross_area",
"error": "grossArea must be a finite number >= 0",
"success": false
}
401
No valid bearer token: missing_token (no Authorization: Bearer header), invalid_token or token_expired.
Example error code: invalid_token
{
"code": "invalid_token",
"error": "Invalid bearer token",
"success": false
}
403
Not a credential for this org and account, or not an account-org-level service-account credential. Nothing was read or changed.
Error code: forbidden
{
"code": "forbidden",
"error": "Org does not belong to this account",
"success": false
}
413
A JSON body over 1,000,000 bytes is bad_request in this envelope. A body over 1 MiB (1,048,576 bytes) is refused earlier by the server, in its own shape ({ "code": "PAYLOAD_TOO_LARGE", ... }).
Error code: bad_request
{
"code": "bad_request",
"error": "Bad request",
"success": false
}
429
Too many requests, or too many batches or updates started; see Retry-After.
Error code: rate_limited
{
"code": "rate_limited",
"error": "Too many batches started; try again shortly",
"success": false
}
502
The job could not be started and was cancelled; some updates may already have been applied.
Error code: jobs_unavailable
{
"code": "jobs_unavailable",
"error": "The batch could not be started and was cancelled; some updates may already have been applied",
"success": false
}
503
Batches and updates are not available right now (batches_unavailable, jobs_unavailable), or a check this API depends on is unavailable (upstream_unavailable); retry.
Example error code: batches_unavailable
{
"code": "batches_unavailable",
"error": "Batches are temporarily unavailable; try again shortly",
"success": false
}