Send multiple requests

POST /requests

This endpoint allows you to send multiple requests to new contacts or existing contacts.

application/json

Body

  • campaignId string Required

    The ID of the campaign you want to send a request.

  • contacts array[string | object] Required

    An array of the contacts you want to send the request to. You can send requests up to 50 contacts per API call (considering your account's limitation). Each contact can be a string representing the ID of an existing contact or a contact object in JSON format. (click here for more details)

    One of:
  • items array[string]

    An array of itemId. If you want to request only few items (documents and forms) of the campaign, you can optionaly specify which items you want to retrieve.

  • samples object

    An array of object. Each object represents the sample of a document element. The object must contain 2 parameters: 'itemId' and 'url'.

    Hide samples attributes Show samples attributes
  • dueDate string

    The due date of the request. The due date should be encoded as a string using ISO 8601 format.

  • The ID of the team member you want to assign the request to. You can also use the email address of the team member.

  • Boolean. If set to false, the sequence of messages planned in your campaign will not be sent.

  • Boolean. If set to true, a message will be automatically send when the request status will be changed to "completed". This message can be customized in the branding settings used for this campaign.

Responses

POST /requests
curl \
 -X POST https://api.usecollect.com/v1/requests \
 --user "username:password" \
 -H "Content-Type: application/json" \
 -d '{"campaignId":"xvr69EYLKXvTkfYuk","contacts":["WmTjsFknzHdmfs3Ra",{"email":"elon@example.com","firstName":"Elon","lastName":"Musk"}]}'
Request example
{
  "campaignId": "xvr69EYLKXvTkfYuk",
  "contacts": [
    "WmTjsFknzHdmfs3Ra",
    {
      "email": "elon@example.com",
      "firstName": "Elon",
      "lastName": "Musk"
    }
  ]
}
Response examples (200)
{
  "requests": [
    {
      "_id": "nw42MmBsJoccgutST",
      "campaignId": "xvr69EYLKXvTkfYuk",
      "createdAt": "2022-07-04 07:20:06 UTC",
      "portalUrl": "https://app.usecollect.com/portal/uGFRDeEL3Ct2uYo2c/nw42MmBsJoccgutST",
      "status": "pending",
      "dueDate": "2022-07-11 21:59:00 UTC",
      "privacy": "private",
      "contact": {
        "_id": "WmTjsFknzHdmfs3Ra",
        "email": "johndoe@example.com",
        "firstName": "John",
        "lastName": "Doe",
        "nbRequest": 5,
        "createdAt": "2022-07-03 13:51:27 UTC",
        "lastActivity": "2022-07-04 07:20:06 UTC"
      },
      "branding": {
        "useBranding": false
      },
      "sendCompletionMessage": true
    },
    {
      "_id": "jdDzbxP8MnfBdrRuM",
      "campaignId": "xvr69EYLKXvTkfYuk",
      "createdAt": "2022-07-04 07:20:06 UTC",
      "portalUrl": "https://app.usecollect.com/portal/uGFRDeEL3Ct2uYo2c/jdDzbxP8MnfBdrRuM",
      "status": "pending",
      "dueDate": "2022-07-11 21:59:00 UTC",
      "privacy": "private",
      "contact": {
        "_id": "ngxhLDiDGEBS2jjKh",
        "email": "elon@example.com",
        "firstName": "Elon",
        "lastName": "Musk",
        "company": "Tesla",
        "nbRequest": 1,
        "createdAt": "2022-07-04 07:20:06 UTC",
        "lastActivity": "2022-07-04 07:20:06 UTC"
      },
      "branding": {
        "useBranding": false
      }
    }
  ],
  "contacts": [
    "WmTjsFknzHdmfs3Ra",
    {
      "_id": "ngxhLDiDGEBS2jjKh",
      "email": "elon@example.com",
      "firstName": "Elon",
      "lastName": "Musk",
      "createdAt": "2022-07-04 07:20:06 UTC"
    }
  ],
  "errors": []
}