Create Blueprint States

Purpose

To create one or more states for an existing blueprint in your Zoho CRM organization.

Endpoints

  • POST /settings/blueprints/{blueprint_id}/states

Request Details

Request URL

{api-domain}/crm/{version}/settings/blueprints/{blueprint_id}/states

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

ZohoCRM.settings.blueprint.ALL
(or)ZohoCRM.settings.blueprint.states.ALL
(or)
ZohoCRM.settings.blueprint.CREATE

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v8/settings/blueprints/4794410000001087101/states"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-d @createblueprint.json
-X POST

Input JSON

The states JSON array is the root element within which all blueprint states for creating blueprint states must be specified. In a request up to 50 blueprint states can be created. The states JSON array must include the following keys:

  • process_idstring, optional

    ID of the blueprint for which the state is to be created.

  • 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": [
    {
      "process_id": "4794410000001096657",
      "module": {
        "api_name": "Leads",
        "id": "4794410000000000125"
      },
      "pick_list_value": {
        "actual_value": "State_2341",
        "id": "4794410000000002341"
      },
      "state_escalation": {
        "period": "days",
        "value": 12,
        "trigger_details": [
          {
            "period": "days",
            "execute_type": "on",
            "value": 0,
            "actions": [
              {
                "type": "email_notifications",
                "details": {
                  "name": "Email Alert",
                  "id": "4794410000001096634"
                }
              },
              {
                "type": "field_updates",
                "details": {
                  "name": "Field Update",
                  "id": "4794410000001096138",
                  "details": {
                    "module": {
                      "api_name": "Leads",
                      "id": "4794410000000000125"
                    }
                  }
                }
              },
              {
                "type": "sla",
                "details": {
                  "name": "SLA",
                  "escalate_to": [
                    {
                      "id": "4794410000000642001",
                      "type": "user"
                    }
                  ]
                }
              }
            ]
          }
        ]
      }
    }
  ]
}

Possible Errors

  • INVALID_DATA HTTP 400

    Invalid blueprint ID or state ID.

Sample Response

Copied{
  "states": [
    {
      "code": "SUCCESS",
      "details": {
        "id": "4794410000001096524"
      },
      "message": "State created successfully",
      "status": "success"
    }
  ]
}