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'.

    Additional properties are allowed.

    Hide samples attributes Show samples attributes object
    • itemId string
    • url string
  • dueDate string

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

  • assignedTo string

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

  • sendMessage boolean

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

  • sendCompletionMessage boolean

    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.

  • sendRejectionMessage boolean

    Boolean. If set to true, a message will be automatically send when the request status will be changed to "pending" and at least one element on the portal has been rejected. This message can be customized in the branding settings used for this campaign.

  • sendReopenMessage boolean

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

Responses

  • 200 application/json

    Success

    Hide response attributes Show response attributes object
    • requests array[object]
      Hide requests attributes Show requests attributes object
      • _id string
      • campaignId string
      • createdAt string(date-time)
      • portalUrl string
      • status string
      • dueDate string(date-time)
      • privacy string
      • contact object

        Additional properties are allowed.

        Hide contact attributes Show contact attributes object
        • _id string
        • email string(email)
        • firstName string
        • lastName string
        • company string
        • tag array[string]
        • custom array[object]
          Hide custom attributes Show custom attributes object
          • _id string
          • name string
          • variable string
          • value string
      • branding object

        Additional properties are allowed.

        Hide branding attributes Show branding attributes object
        • useBranding boolean
        • brandingId string
    • contacts array[string | object]
      One of:
    • errors array
  • 400

    Bad Request -- Your request is invalid.

  • 401

    Unauthorized -- Your API key is wrong.

  • 403

    Forbidden -- The object requested is hidden for administrators only.

  • 404

    Not Found -- The specified object could not be found.

  • 429

    Too Many Requests -- You're requesting too many objects! Slow down!

  • 500

    Internal Server Error -- We had a problem with our server. Try again later.

  • 503

    Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

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