Update Blueprint States
Purpose
To update one or more states for an existing blueprint in your Zoho CRM organization.
Endpoints
- PUT /settings/blueprints/{blueprint_ID}/states
- PUT /settings/blueprints/{blueprint_ID}/states/{blueprint_state_ID}
Request Details
Request URL
{api-domain}/crm/{version}/settings/blueprints/{blueprint_id}/states
{api-domain}/crm/{version}/settings/blueprints/{blueprint_id}/states/{blueprint_state_id}
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
ZohoCRM.settings.blueprint.ALL
(or)ZohoCRM.settings.blueprint.states.ALL
(or)
ZohoCRM.settings.blueprint.states.UPDATE
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/blueprints/4794410000001087101/states/4794410000001087332"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d @updateblueprint.json
-X POSTRequest JSON
The states JSON array is the root element within which all blueprint states for updating blueprint states must be specified. In a request upto 50 blueprint states can be updated. The states JSON array must include the following keys:
- process_idstring, optional
Id of the blueprint for which the state is to be updated.
- state_escalationJSON object, optional
Contains details of the state escalation alerts configured for the state.
- periodstring, mandatory
Type of the period.
Possible values: days, hours, minutes, business_days, business_hours. - valueinteger, mandatory
Maximum duration for which the record can remain in the state.
- trigger_detailsJSON array, mandatory
Defines triggers configured for the escalation.
- periodstring, mandatory
Period type for trigger execution.
Possible values: days, hours, minutes, business_days, business_hours. - execute_typestring, mandatory
Defines when the action should execute.
Possible values: before, on, after. - valueinteger, mandatory
Time value for the trigger execution.
- actionsJSON array, mandatory
List of actions executed when the trigger condition is met.
- detailsJSON object, mandatory
Details of the configured action.
- namestring, optional
Name of the action.
- idstring, mandatory
Id of the automation action.
- typestring, mandatory
Type of action.
Possible values: sla, email_notifications, tasks, field_updates, webhooks, functions, circuits, whatsapp, sms.
- moduleJSON object, mandatory
Module for which the blueprint state is configured.
- api_namestring, optional
API name of the module.
- idstring, mandatory
Id of the module.
- pick_list_valueJSON object, mandatory
Picklist option mapped to the state.
- actual_valuestring, optional
Actual value of the picklist option.
- idstring, mandatory
Id of the picklist option.
Sample Input
Copied{
"states": [
{
"id": "479441000000123433",
"state_escalation": {
"period": "days",
"value": 10,
"trigger_details": [
{
"period": "days",
"execute_type": "on",
"value": 14,
"actions": [
{
"details": {
"escalate_to": [
{
"id": "479441000000023477",
"type": "user"
}
],
"name": "SLA"
},
"name": "SLA",
"type": "sla"
}
]
}
]
}
}
]
}Possible Errors
- MANDATORY_NOT_FOUNDHTTP 400
Required action type is missing.
Resolution: Specify the type field inside actions. - INVALID_DATAHTTP 400
The period specified in trigger details is invalid.
Resolution: Specify valid values such as days, hours, or minutes. - MANDATORY_NOT_FOUNDHTTP 400
Required period is missing in trigger details.
Resolution: Specify the period field in trigger details. - MANDATORY_NOT_FOUNDHTTP 400
Required value is missing in trigger details.
Resolution: Specify the value field in trigger details. - INVALID_DATAHTTP 400
Invalid execute type specified in trigger details.
Resolution: Specify valid values such as before, on, or after. - MANDATORY_NOT_FOUNDHTTP 400
Required execute type is missing in trigger details.
Resolution: Specify the execute_type field. - MANDATORY_NOT_FOUNDHTTP 400
Required actions field is missing in trigger details.
Resolution: Specify the actions array in trigger details. - DEPENDENT_FIELD_MISSINGHTTP 400
Dependent field is missing in state escalation.
Resolution: Specify both period and value fields together. - INVALID_DATAHTTP 400
Invalid action type specified.
Resolution: Specify valid action types such as sla, email_notifications, tasks, field_updates, webhooks, functions, circuits, whatsapp, or sms. - INVALID_DATAHTTP 400
The action ID specified is invalid.
Resolution: Specify a valid action ID. - INVALID_DATAHTTP 400
The trigger detail ID specified is invalid.
Resolution: Specify a valid trigger detail ID. - INVALID_DATAHTTP 400
The blueprint ID given seems to be invalid.
Resolution: Specify a valid blueprint ID. - INVALID_DATAHTTP 400
The state ID given seems to be invalid.
Resolution: Specify a valid state ID. - REQUIRED_HEADER_MISSINGHTTP 400
One of the expected headers is missing - X-CRM-ORG.
Resolution: Specify the X-CRM-ORG header in the request. - REQUIRED_HEADER_MISSINGHTTP 400
One of the expected headers is missing - X-ZOHO-SERVICE.
Resolution: Specify the X-ZOHO-SERVICE header in the request.
Sample Response
Copied{
"states": [
{
"code": "SUCCESS",
"details": {
"id": "4794410000001087332"
},
"message": "State updated successfully",
"status": "success"
}
]
}