Update Maintenance Agreement by ID
curl --request PUT \
--url https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/maintenance-agreements/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "some string",
"status_id": 1
}
'import requests
url = "https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/maintenance-agreements/{id}"
payload = {
"title": "some string",
"status_id": 1
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'some string', status_id: 1})
};
fetch('https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/maintenance-agreements/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": true,
"errors": [
"error message",
"error message"
]
}Maintenance Agreements
Update Maintenance Agreement by ID
PUT
/
maintenance-agreements
/
{id}
Update Maintenance Agreement by ID
curl --request PUT \
--url https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/maintenance-agreements/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "some string",
"status_id": 1
}
'import requests
url = "https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/maintenance-agreements/{id}"
payload = {
"title": "some string",
"status_id": 1
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'some string', status_id: 1})
};
fetch('https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/maintenance-agreements/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": true,
"errors": [
"error message",
"error message"
]
}Body raw (json)
{
"customer_id",// nullable | required, if is_template is false or not set | integer | existing customer id | prohibited when is_template is true
"title",// required | string | max:255
"status_id",// required | integer | existing custom status id | description: object type maintenance_agreement. A completed status must pass completion checks.
"status_workflow_id",// nullable | integer | existing status workflow id | description: object type maintenance_agreement
"customer_contact_id",// nullable | integer | existing customer contact id | prohibited when is_template is true
"parent_invoice_id",// nullable | integer | existing invoice id | description: not a template, and the agreement customer when a customer is set
"timezone",// nullable | string | description: PHP timezone identifier
"start_time",// nullable | integer | description: timestamp. A date string is also accepted.
"end_time",// nullable | integer | description: timestamp, same as or after start_time. A date string is also accepted.
"job_location",// nullable | string | max:255
"agreement_notes",// nullable | string
"job_notes",// nullable | string
"is_template",// nullable | boolean
"recurring_update_mode",// nullable | string | acceptable_values: only_future,all,only_past | description: only_past does not save the agreement itself
"asset_ids",// nullable | array | description: array of existing asset ids
"settings",// nullable | array | description: stored as sent. No child-key rules.
"tags",// nullable | array | description: tag ids, or objects {"id": tag id}. Type must be maintenance_agreement.
"assignments": [// nullable | array | description: teams only. Each team is expanded to one assignment per member.
{
"team_id",// required | integer | existing team id
}
],
"location_id",// nullable | integer | existing location id | prohibited when is_template is true | description: a location of the agreement customer
"parent_job_id",// nullable | integer | existing job id | description: not a template, and the agreement customer when a customer is set
"services_routines": [// required, if billing_routines is not set | array | max:5 | description: full list. An active agreement requires at least one. A scheduled routine cannot carry on_demand_generation_method. An on-demand routine cannot carry schedule_generation_method.
{
"id",// nullable | integer | existing service routine id | description: omit to create. On update, must belong to this agreement.
"title",// required | string | max:255
"rrule",// required, if type is scheduled | nullable | string | description: valid rrule
"type",// required | string | acceptable_values: scheduled,on-demand
"asset_ids",// nullable | array | description: array of existing asset ids
"schedule_generation_method": {// required, if type is scheduled | prohibited, if type is on-demand | array
"creation_method",// required, if schedule_generation_method is set | nullable | string | acceptable_values: manual,automatic
"automatic_creation_method",// required, if schedule_generation_method is set | string | acceptable_values: automatic,find-availability,fixed
"generation_window_in_month",// required, if schedule_generation_method is set | integer | acceptable_values: 1,2,3,6,12,13,18,24
"set_job_template",// nullable | boolean | description: must be true when automatic_creation_method is fixed
"job_template_id",// required, if set_job_template is true | nullable | integer | existing job template id
"fixed_method_rrule",// required, if automatic_creation_method is fixed | nullable | string | description: valid rrule with no start or end
"scheduled_details",// required, if automatic_creation_method is find-availability | nullable | array | description: stored as sent. No child-key rules.
},
"on_demand_generation_method": {// required, if type is on-demand | prohibited, if type is scheduled | array
"generation_window_in_month",// required, if on_demand_generation_method is set | integer | min:1
"amount_of_services",// required, if on_demand_generation_method is set | integer | min:1
"unused_services_policy",// required, if on_demand_generation_method is set | string | acceptable_values: expire,rollover
"set_job_template",// nullable | boolean
"job_template_id",// required, if set_job_template is true | nullable | integer | existing job template id
}
}
],
"services_routine_overlaps": [// optional | array | description: dropped unless both indexed routines are scheduled and creation_method is automatic. One overlap per pair.
{
"id",// nullable | integer | existing overlap id | description: on update, must belong to this agreement
"first_routine_index",// required | integer | min:0 | description: index in services_routines
"second_routine_index",// required | integer | min:0 | description: a different services_routines index. The pair may appear only once.
"generation_method": {// required | array
"creation_method",// nullable | string | acceptable_values: manual,automatic
"automatic_creation_method",// required | string | acceptable_values: automatic,find-availability,fixed
"generation_window_in_month",// required | integer | acceptable_values: 1,2,3,6,12,13,18,24
"set_job_template",// nullable | boolean | description: must be true when automatic_creation_method is fixed
"job_template_id",// required, if set_job_template is true | nullable | integer | existing job template id
"fixed_method_rrule",// required, if automatic_creation_method is fixed | nullable | string | description: valid rrule with no start or end
"scheduled_details",// required, if automatic_creation_method is find-availability | nullable | array | description: stored as sent. No child-key rules.
}
}
],
"communication": [// optional | array | description: full list. Triggers omitted from the payload are deleted.
{
"id",// nullable | integer | existing communication trigger id
"send_type",// required | string | acceptable_values: email,sms
"target_routine_mode",// required | string | acceptable_values: all,multiple,single
"type",// nullable | string | acceptable_values: reminder,renewal
"routine_indexes",// required, if target_routine_mode is single or multiple | nullable | array | description: services_routines indexes. Exactly one when target_routine_mode is single. Not checked when target_routine_mode is all.
"notify_before_date_in_days",// required | integer | min:0
"scheduled_statuses",// nullable | array | description: acceptable values draft,unscheduled,scheduled,completed,failed. Stored as a comma-separated string.
"user_to_send",// nullable | array | description: array of existing user ids. Stored as a comma-separated string.
"email_subject",// required, if send_type is email | nullable | string | max:255
"body",// required | string
"send_to_users",// required | boolean
"send_to_customer",// required | boolean
}
],
"billing_routines": [// optional | array | max:1 | description: an active agreement requires exactly one
{
"id",// nullable | integer | existing billing routine id | description: on update, must belong to this agreement
"title",// required | string | max:255
"creation_method",// required | string | acceptable_values: manual,recurring-billing
"rrule",// required, if creation_method is manual | nullable | string | description: valid rrule
"recurring_billing_id",// required, if creation_method is recurring-billing | prohibited, if creation_method is manual | nullable | integer | existing recurring billing id
"price_per_bill",// required | numeric | min:0
"generation_window_in_month",// required | integer | min:1
"initial_occurrence_estimate_id",// nullable | integer | existing estimate id | description: mutually exclusive with initial_occurrence_invoice_id. Only a new billing routine converts it.
}
],
"customfields": [// nullable | array | description: array of custom fields
{
"id",// nullable | required, if field_instance_id is not set | integer | existing custom field instance id
"field_instance_id",// nullable | required, if id is not set | integer | existing custom field instance id
"value",// nullable | description: must match the custom field type when set
}
]
}
Body
application/json
Full list. An active agreement requires at least one. A scheduled routine cannot carry on_demand_generation_method. An on-demand routine cannot carry schedule_generation_method. Required if billing_routines is not set.
Maximum array length:
5Hide child attributes
Hide child attributes
Required if type is scheduled. Prohibited, if type is on-demand.
Hide child attributes
Hide child attributes
Required if type is on-demand. Prohibited, if type is scheduled.
Hide child attributes
Hide child attributes
Dropped unless both indexed routines are scheduled and creation_method is automatic. One overlap per pair.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Full list. Triggers omitted from the payload are deleted.
Hide child attributes
Hide child attributes
An active agreement requires exactly one.
Maximum array length:
1Hide child attributes
Hide child attributes
Array of custom fields.
Hide child attributes
Hide child attributes