Lead Files

After a lead has been created, files can be upload and attached to the lead.

Users with a team of type agency are able to access the files when the lead is showed in the agency section, while users with a team of type dealer get access to the file(s) after accepting the lead (when viewing the case.)

Please note: As at 19th December 2017, these endpoints are deprecated. To ensure the efficacy of your request, please refer to the new File documentation.

Upload & attach file to lead

This endpoint is deprecated and will be removed July 1st, 2018. The Upload file and the Create attachment endpoints can be used instead.

POST /leads/:lead_id/files

Headers

Content-Type: multipart/form-data

Parameters

  • file file
    • Required
    • Maximum file size is 10 megabytes

Response

200 OK

{
    "id": "99918592-ceda-4dcc-8510-9b9619509f9d",
    "name": "image.gif",
    "type": "gif",
    "size": 4915093,
    "created_at": "2017-07-13 12:15:20",
    "updated_at": "2017-07-13 12:15:20"
}

Update lead file

Do not define a Content-Type with this request

This endpoint is deprecated and will be removed July 1st, 2018. The Update file endpoint can be used instead.

PUT /leads/:lead_id/files/:file_id

{
    "name": "example.gif"
}

Response

200 OK

{
    "id": "99918592-ceda-4dcc-8510-9b9619509f9d",
    "name": "example.gif",
    "type": "gif",
    "size": 4915093,
    "created_at": "2017-07-13 12:15:20",
    "updated_at": "2017-07-13 12:15:20"
}

Delete lead file

Do not define a Content-Type with this request

This endpoint is deprecated and will be removed July 1st, 2018. The Detach files from attachment endpoint can be used instead.

DELETE /leads/:lead_id/files/:file_id

Response

204 No Content

Get lead files

Do not define a Content-Type with this request

GET /leads/:lead_id/files

Response

200 OK

{
    "data": [
        {
            "id": "99918592-ceda-4dcc-8510-9b9619509f9d",
            "name": "image.gif",
            "type": "gif",
            "size": 4915093,
            "created_at": "2017-07-13 12:15:20",
            "updated_at": "2017-07-13 12:15:20",
            "download_url": "http://example.com/downloads/image.gif"
        }
    ]
}