Upload KYC Document

This is a Multi-part file upload, it consists of a json body with metadata and the file contents in the "file" key.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

❗️

This endpoint differs from all the others because this is a Multi-part file upload instead of application/json

This is an example code that can be used to upload a file to this endpoint

import requests

def upload_file(url, file_name):
    data = {
        "document_type": "id_front",
        "file_length": 1024,
        "file_type": "image/png"
    }

    files = {
        "file": open(file_name, 'rb'),
    }

    resp = requests.post(url, files=files, data=data)

Please note that the example call generated by this page is not currently working, you need to add the "filename" field to the request, which is not added by the automatic call generator.

This is a valid request:

curl 'https://api.lirium-sandbox.com/v1/customers/{customer id}/documents' \
-H 'authorization: Bearer {JWT Token}'  \
-H 'content-type: multipart/form-data; boundary=----EXAMPLEMULTIPARTLIRIUMTEST--------'  \
 --data-raw $'------EXAMPLEMULTIPARTLIRIUMTEST--------\r\nContent-Disposition: form-data; name="document_type"\r\n\r\n{document type}\r\n------EXAMPLEMULTIPARTLIRIUMTEST--------\r\nContent-Disposition: form-data; name="file_type"\r\n\r\n{file type}\r\n------EXAMPLEMULTIPARTLIRIUMTEST--------\r\nContent-Disposition: form-data; name="file"; filename="sample1.jpg\r\n\r\n{file binary content}\r\n------EXAMPLEMULTIPARTLIRIUMTEST----------\r\n'

❗️

Content-Type

Supported file types:

  • application/pdf
  • image/png
  • image/jpeg
  • image/gif

We currently have a maximum upload size of 2MB, sending a file larger than this will result in an error (with http_code 413)

Path Params
string
required
Body Params
string
required
Defaults to id_front
string
required
Defaults to image/png
file
required

File content bytes

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json