Update a work order
https://carchost.fieldcontrol.com.br/orders/{id}Updates the data of a work order and the custom field answers sent. Tasks, products and services have their own endpoints.
Requires the
X-Api-Key,User-AgentandContent-Type: application/jsonheaders. Limit: 1 request per second (learn more).
Request
Path parameters
idstringrequiredWork order identifier.
Example: NDJiMWQ0YzQtOWNmOC00NWE2LTg2MjItYjNjNzZjZjk0MmM4OjIyOTE1.
Headers
User-AgentstringrequiredIdentification of your application.
Example: MinhaIntegracao/1.0.
Request body
JSON, sent with the Content-Type: application/json header.
identifierstringOrder number, unique in the account. If omitted, it is generated according to the account settings; in accounts with manual numbering, it is required. The # character in the middle is reserved.
At least 1 characters.Accepts: null.
descriptionstringWork order description. Texts longer than 2,000 characters are truncated.
customerobjectrequiredCustomer, by id or by name (partial match, uses the first one found).
Fields of customer
idstringnamestringserviceobjectrequiredWork order type, by id or by name (partial match, uses the first one found).
Fields of service
idstringnamestringlocationobjectCustomer location, by id or by name. If omitted, the API uses the customer's primary location.
Fields of location
idstringnamestringticketobjectService request handled by this order. It is accepted and archived. Ignored on update.
Accepts: null.
Fields of ticket
idstringrequireddeadlineAtstringDeadline date (AAAA-MM-DD). Send null to remove the deadline; if omitted on update, the current value is kept.
Accepts: null.
deadlineContractobjectDeadline contract. Only applied on creation. Cannot be sent together with serviceAgreement.
Fields of deadlineContract
idstringrequiredserviceAgreementobjectService agreement. Only applied on creation. Cannot be sent together with deadlineContract.
Fields of serviceAgreement
idstringrequiredexternalobjectFields of external
idstringWork order identifier in your system.
Up to 100 characters.Accepts: null.
addressobjectrequiredFields of address
zipCodestringrequired8-digit postal code (CEP), digits only.
streetstringrequiredStreet. Texts longer than 50 characters are truncated.
numberstringrequiredNumber. Texts longer than 10 characters are truncated.
neighborhoodstringNeighborhood. Texts longer than 50 characters are truncated.
complementstringAddress complement. Texts longer than 50 characters are truncated.
Accepts: null.
citystringrequiredCity. Texts longer than 50 characters are truncated.
statestringrequiredState. Texts longer than 30 characters are truncated.
coordsobjectrequiredFields of coords
latitudenumberrequiredFrom -90 to 90.
longitudenumberrequiredFrom -180 to 180.
metadataobjectInternal metadata. Only accepted with the shagrat key.
customFieldslist of objectsAnswers to the custom fields of the work order type. Only the fields sent are changed; value: null removes the answer. On update, each field is identified by its id.
Display conditions (condition) are evaluated with the stored answers together with the ones sent. Answering a hidden field returns 422 (hidden by condition), and a required field with a condition that becomes visible without an answer returns 422 (required). When the answer to a trigger changes, the answers to the fields that become hidden are deleted.
Fields of customFields
idstringrequiredIdentifier of the custom field, from the order's work order type. Each field can be sent once.
valuestring or numberrequiredAnswer, validated according to the field type: question, text of up to 500 characters; number, a number (or numeric text); date, a AAAA-MM-DD date; multiple-choice, one of the registered options. checklist, attachment and multiple-photos fields cannot be answered through the API. null leaves the field unanswered. In the legacy format, text of 1 to 500 characters, not validated by type.
Accepts: null.
taskslist of objectsWork order tasks. Required on creation, with at least one; ignored on update.
Fields of tasks
statusstringrequiredTask status.
Accepted values: pending, scheduled, in-progress, done, canceled, reported, on-route, paused.
employeeobjectEmployee in charge.
Fields of employee
idstringEmployee identifier.
namestringEmployee name. Texts are accepted, but the link is made by id.
taskTypeobjectTask type.
Fields of taskType
idstringTask type identifier.
descriptionstringTask description.
Accepts: null.
statusDescriptionstringNote about the status. Up to 6,000 characters.
Accepts: null.
durationintegerExpected duration, in minutes. If omitted when creating the order, the API uses the duration of the work order type.
Accepts: null.
positionintegerOrder of the task within the work order.
Default: 100.
archivedbooleanArchives the task.
Default: false.
schedulingobjectrequiredScheduling. type is calculated: with date and time it becomes scheduled-date-and-time, with only date it becomes scheduled-date, and without a date it becomes non-scheduled.
Fields of scheduling
typestringIgnored; calculated from date and time.
Accepted values: scheduled-date, scheduled-date-and-time, non-scheduled.
datestringDate (AAAA-MM-DD).
Accepts: null.
timestringTime (HH:MM:SS).
Accepts: null.
coordsobjectrequiredCoordinates of the task location.
Fields of coords
latitudenumberrequiredlongitudenumberrequiredResponses
- 200
Work order updated.
- 401
API key missing (
Missing API Key) or invalid (Invalid API Key). See Authentication. - 403
Account blocked (
Account blocked), expired (Account expired) or on a plan that does not allow integration (Account plan not allowed). See Authentication. - 404
Resource not found. The response body is empty.
- 422
Invalid body (resourceValidationErr). An invalid identifier, or one from another account, in the URL also returns this error, with
property: '@.id'. - 429
Limit of 1 request per second exceeded. See Rate limit.
- 500
Unexpected server error.