Add an element

POST /elements

This endpoint allows you to add an element to an existing request. You can currently add docs, text and pages. form will come later.

Body object

One of:

Responses

POST /elements
curl \
 -X POST https://api.usecollect.com/v1/elements \
 --user "username:password" \
 -H "Content-Type: application/json" \
 -d '{"requestId":"bbbBkrejSaJkHWwDE","type":"docs","name":"ID","order":3}'
Request examples
{
  "requestId": "bbbBkrejSaJkHWwDE",
  "type": "docs",
  "name": "ID",
  "order": 3
}
{
  "requestId": "GTonevwqoPPJ2PYEy",
  "type": "text",
  "order": 4,
  "text": "Hello World!"
}
{
  "requestId": "GTonevwqoPPJ2PYEy",
  "type": "page",
  "order": 2,
  "name": "More details"
}
Response examples (200)
{
  "id": "eEDJFD5unNQTHoSBZ",
  "itemId": "urRJfPK7CfyGBnHg8",
  "name": "ID",
  "order": 3,
  "visibility": true,
  "status": "open",
  "mandatory": true,
  "multipleupload": true,
  "uploads": [],
  "type": "docs",
  "request": {
    "_id": "bbbBkrejSaJkHWwDE",
    "campaignId": "7gDq3XyLyixkhqoHa"
  }
}
{
  "id": "BKJ95xmpHSyo7KuRC",
  "itemId": "7LBBC8LwnBnQoz8ae",
  "name": "Text block",
  "order": 4,
  "visibility": true,
  "type": "text",
  "text": "Hello World!",
  "request": {
    "_id": "GTonevwqoPPJ2PYEy",
    "campaignId": "3ya2sjN9GYwYAHeSi"
  }
}
{
  "id": "XigRzPs4N5vwX3Rks",
  "itemId": "L3uAmzDRJjWTm2TMR",
  "name": "More details",
  "order": 2,
  "visibility": true,
  "type": "page",
  "request": {
    "_id": "GTonevwqoPPJ2PYEy",
    "campaignId": "3ya2sjN9GYwYAHeSi"
  }
}