Skip to main content

Attaching files and videos to a B2C ticket through the API

Written by Support team

Written so it can be forwarded to an integrator as is. Everything below is also in the swagger documentation at

https://server-claimlane.claimlane.com/api-docs/

Two ways to send a file

Inline base64

Upload URL (recommended for video)

How

Put the file's content, base64 encoded, directly in the create ticket request.

Ask for an upload URL, send the file to it, then reference the returned file id in the create ticket request.

Best for

Photos and small documents.

Videos, large documents, anything above a few MB.

Limit

Same per-file limits as below, but the whole request must stay under 50 MB and base64 makes a file a third larger.

Per-file limits below, nothing else.

Calls

One.

Three: upload URL, PUT, create ticket.

Both can be mixed freely in one request. A ticket can have a base64 receipt photo and an uploaded fault video.

Limits and accepted file types

Kind

Accepted types

Max size per file

Image

jpeg, png, gif, webp, avif, bmp, ico, svg

15 MB

Video

Any video/* type, for example mp4, quicktime (mov), webm

15 MB

Document

pdf, doc, docx, rtf, txt, xls, ods, csv, tsv, ppt, pptx, odp

50 MB

  • HEIC, HEIF and TIFF are not accepted. Convert them to JPEG or PNG first.

  • Videos must be compressed before sending. Our own consumer portal produces files around 6 MB at 960 px wide, which is plenty for agents to assess a fault.

  • Files are stored and shown exactly as sent. Nothing is resized, converted or transcoded.

Step by step: upload URL flow

Step 1. Request an upload URL. Send the file's MIME type and its exact size in bytes.

POST /api/v2/company/b2c-tickets/file-uploads 
api-key: <your key>
Content-Type: application/json
{ "contentType": "video/mp4", "byteSize": 4823190 }

Response:

{
"success": true,
"fileId": "api/6aa9834c134cfaad181e8117/2f1c9d4e-7b3a-4c1e-9f0a-1d2e3f4a5b6c",
"uploadUrl": "https://....amazonaws.com/api/6aa9834c134cfaad181e8117/2f1c9d4e-...?X-Amz-Algorithm=...",
"method": "PUT",
"headers": { "Content-Type": "video/mp4", "Content-Length": "4823190" },
"expiresInSeconds": 3600
}

The endpoint answers 400 if the type is not accepted or the size is above the limit, so a rejected file costs nothing.

Step 2. Send the file to the upload URL. A plain HTTP PUT of the raw bytes with exactly the two headers from the response. No multipart form, no base64, no api-key.

curl -X PUT "<uploadUrl>" -H "Content-Type: video/mp4" -H "Content-Length: 4823190" --upload-file fault.mp4

An empty 200 means the upload is complete. The storage rejects the PUT with 403 if the size or type differs from what was requested in step 1, so the limits are enforced on the upload itself. The URL is valid for one hour; request a new one if it expires. An unused upload URL is harmless.

Step 3. Create the ticket and reference the file. Use fileId together with the file name you want agents to see, wherever a file is accepted: pictures of the fault, of the receipt, of the product, or a data source file upload configured on the flow.

POST /api/v2/company/b2c-tickets
api-key: <your key>
Content-Type: application/json

{
"b2cFlowId": "<flow id from Claimlane>",
"consumer": { "email": "[email protected]", "name": "Jane Doe", "countryCode": "us" },
"products": [
{
"name": "CORE 500 Digital Stethoscope",
"sku": "COR501",
"faultDescription": "Stopped charging and will not turn on",
"picturesOfFault": [
{ "filename": "fault.mp4", "fileId": "api/6aa9834c134cfaad181e8117/2f1c9d4e-7b3a-4c1e-9f0a-1d2e3f4a5b6c" }
],
"picturesOfReceipt": [
{ "filename": "receipt.jpg", "contentType": "image/jpeg", "base64": "/9j/4AAQSkZJRg..." }
]
}
]
}

The response carries the ticket id, the ticket number and the receipt page URL, exactly as for a ticket without files. The video plays in the agent inbox as the fault picture.

Rules to know

  • Each file needs filename and exactly one of base64 (with contentType) or fileId.

  • A fileId must have been issued to your API key and its upload must be complete. Otherwise the create call answers 400 and no ticket is created.

  • The stored type of an uploaded file is what the create call uses, so contentType is not needed with fileId.

  • A data source file upload only accepts the file kinds configured on it in Claimlane. Sending another kind answers 400.

  • Every product needs a name, the same as in the consumer portal.

  • The whole create request must stay under 50 MB, which is why large files go through the upload URL.

Errors you may see

Status

Meaning

400 on the upload URL call

Type not accepted, size above the limit, or a missing field. The message names the problem.

403 on the PUT

The size or type of the bytes sent differs from what was requested. Request a new URL with the correct values.

400 on create

A file id that was not issued to you or was never uploaded, a file with neither or both of base64 and fileId, a type not allowed on that data source upload, or a product without a name. The message names the file.

Not offered in this version

Sending us a link to download from, server-side video processing or thumbnails, and attaching files to a ticket after it has been created. If any of these becomes necessary, tell us and we will scope it.

Did this answer your question?