CRM

API to create multiple allocations and assign to users based on common pool, workflow rule, or assignedTo number

post/crm/allocations

Query parameters

results'off' | 'all' | 'failed'

Level of detail in response: off=count only, failed=failed and count, all=success, failed and count

Request body

processNamestring required

Process name in which these allocations should be created

isCommonPoolboolean nullable

When isCommonPool is true, all the allocations will be uploaded into common pool

ruleNamestring nullable

Allocation rule name, based on which these allocations are being assigned

assignedTostring nullable

Phone number of the user to which these allocations should be assigned. Phone number should have country code in it

existingDataUpdateMethod'update' | 'override' nullable

Method to handle existing data updates. Either 'update' or 'override'

Example request

{
  "processName": "Default Process",
  "isCommonPool": false,
  "ruleName": "City Based Rule",
  "existingDataUpdateMethod": "update",
  "allocations": [
    {
      "customer": {
        "name": "Rohit Agarwal",
        "phoneNumber": "+919898989898",
        "email": "rohit.agarwal@gmail.com",
        "company": {
          "name": "Agarwal Foods Limited",
          "address": {
            "street": "84-2, Main road",
            "city": "RAIPUR",
            "state": "Chattisgarh",
            "country": "India",
            "pincode": 578100
          },
          "kdm": {
            "name": "Varun Agarwal",
            "phoneNumber": "+919696969696"
          }
        }
      },
      "priority": 3,
      "notes": "Customer is interested and asked to drop details on mail",
      "whatsAppConsent": false,
      "userFields": [
        {
          "name": "source",
          "value": "Referral"
        },
        {
          "name": "status",
          "value": "Cold Followup"
        }
      ]
    }
  ]
}

Response

If the auth token is valid.

messagestring
statusCodenumber

Example response

{
  "message": "Successfully added 2 allocations",
  "statusCode": 0,
  "data": {
    "count": {
      "success": 2,
      "failure": 1
    },
    "success": [
      {
        "name": "Rohit Agarwal",
        "phone": "+919898989898",
        "assignedTo": "+919876543210"
      },
      {
        "name": "Priya Sharma",
        "phone": "+919797979797",
        "assignedTo": "+919876543210"
      }
    ],
    "failed": [
      {
        "name": "John Doe",
        "phone": "+919876543210",
        "reason": "Invalid phone number"
      }
    ]
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.