Sila API Docs | Sila Banking and Payments API

Welcome to the Sila API!

/documents

Upload supporting documentation for KYC

During the KYC onboarding process, it may be necessary to upload supporting documentation. This endpoint will support the upload of images of that documentation.

Requests

The request body at this endpoint is the header_msg JSON object.

header.user_handle should have the registered handle to be verified.

Both authsignature and usersignature headers are required for this request.

Content-Type

  • multipart/form-data

❗️

Content-Type differs from most of the other endpoints.

This endpoint is one of very few which does not have a Content-Type of application/json.

📘

Handling the multipart/form-data boundary value

NodeJS
Do not manually set Content-Type, as this will not include a 'boundary.' Let your request package automatically detect the content type so that it can automatically generate a boundary.

Python
multipart/form-data is the default Content-Type for the python requests module; when using that module, don't set the header's Content-Type, but instead let the requests module use its default, and it will properly determine the multipart/form-data boundary value for you.

🚧

File Size

Maximum file size is 20mb.

POST /0.2/documents HTTP/1.1
Host: sandbox.silamoney.com
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
Content-Type: multipart/form-data

"files": {
  "file": <file_binary_data>
},
"data": {
  "header": {
    "created": 1234567890, 
    "auth_handle": "handle.silamoney.eth", 
    "user_handle":"user.silamoney.eth", 
    "version": "0.2", 
    "crypto": "ETH", 
    "reference": "ref"
  }, 
  "message": "header_msg",
  "name": "CA drivers license",
  "filename": "img_201901022_193206",
  "hash": "046a9aaa83711158c3c4afa585a30be3bee8a34231ee72caac625faef48b4abe",
  "mime_type": "image/jpeg",
  "document_type": "id_drivers_license",
  "identity_type": "license",
  "description": "my CA driver's license from 2019"
}
  
***

HTTP/1.1 200 OK

{
  "success": true,
  "status": "SUCCESS",
  "message": "File uploaded successfully.",
  "reference_id": "2624a0f6-e913-4e09-bfd7-c1bc10543483",
  "document_id": "05e313a5-2cb4-4638-bf74-debe96b931ee"
}
const document = {  
  filePath: '/path/to/file',    
  filename: 'file-name',    
  mimeType: 'image/png',    
  documentType: 'doc_green_card',   
  identityType: 'other',    
  name: 'file name', // Optional    
  description: 'some file description', // Optional 
};  
const res = await sila.uploadDocument(userHandle, userPrivateKey, document);    

// Success Response Object  
console.log(res.statusCode); // 200 
console.log(res.data.success); // true  
console.log(res.data.status); // SUCCESS    
console.log(res.data.message); // File uploaded successfully    
console.log(res.data.reference_id); // some-uuid-code   
console.log(res.data.document_id); // other-uuid-code
import hashlib

f = open("/path/to/file", "rb")
file_contents = f.read()
f.close()

payload = {
    "user_handle": user_handle,
    "filename": "file-name",
    "hash": hashlib.sha256(file_contents).hexdigest(),
    "mime_type": "image/png",
    "document_type": "id_drivers_license", # You can obtain this value from the listSupportedDocuments
    "identity_type": "license", # You can obtain this value from the listSupportedDocuments
    "name": "some file name", # Optional
    "description": "some file description" # Optional
}

response = silasdk.Documents.uploadDocument(app, payload, file_contents, user_private_key)

# Success Response Object
{
  "success": true,
  "status": "SUCCESS",
  "message": "File uploaded successfully.",
  "reference_id": "2624a0f6-e913-4e09-bfd7-c1bc10543483",
  "document_id": "05e313a5-2cb4-4638-bf74-debe96b931ee"
}
UploadDocumentMessage message = UploadDocumentMessage.builder()
        .userHandle("user_handle") // The user handle
        .userPrivateKey("user_private_key") // The user's private key
        .filePath("/path/to/file") // Full path to the file
        .filename("logo-geko") // File name (without extension)
        .mimeType("image/png") // File mime-type
        .documentType("doc_green_card") // Document type
        .identityType("other") // Identity type
        .name("some file name") // Optional. Descriptive name of the document
        .description("some file description") // Optional. General description of the document
        .build();
ApiResponse response = api.uploadDocument(message);

// Success response
System.out.println(response.getStatusCode()); // 200
DocumentsResponse parsedResponse = (DocumentsResponse) response.getData();
System.out.println(parsedResponse.getSuccess()); // true
System.out.println(parsedResponse.getStatus()); // SUCCESS
System.out.println(parsedResponse.getMessage()); // File uploaded successfully
System.out.println(parsedResponse.getDocumentId());
System.out.println(parsedResponse.getReferenceId());
$userHandle = 'user.silamoney.eth';
$privateKey = 'some private key';
$filePath = '/path/to/file';
$fileName = 'some-image'; // The name of the file (without the extension)
$mimeType = 'image/png'; // The mime type of the file
$documentType = 'doc_green_card'; // One of Supported Document Types. You can get this from getDocumentTypes
$identityType = ''; // Matching Identity Type for Document Type. You can get this from getDocumentTypes
$name = ''; // Optional. Descriptive name of the document.
$description = ''; // Optional. General description of the document.
$response = $client->uploadDocument($userHandle, $privateKey, $filePath, $fileName, $mimeType, $documentType, $identityType, $name, $description);

echo $response->getStatusCode(); // 200
echo $response->getData()->success; // TRUE
echo $response->getData()->status; // SUCCESS
echo $response->getData()->message; // File uploaded successfully.
echo $response->getData()->reference_id; // The reference uuid
echo $response->getData()->document_id; // The document uuid
// Name is optional
// Description is optional
var response = api.UploadDocument(userHandle, privateKey, filepath, filename, mimeType, documentType, identityType, name, description);

// Success Object Response
Console.WriteLine(200, response.StatusCode);
var parsedResponse = (DocumentResponse)response.Data;
Console.WriteLine(parsedResponse.Success); // true
Console.WriteLine(parsedResponse.Status); // SUCCESS
Console.WriteLine(parsedResponse.Message); // File uploaded successfully
Console.WriteLine(parsedResponse.ReferenceId); // some-uuid-code
Console.WriteLine(parsedResponse.DocumentId); // other-uuid-code

Document Metadata

Key Name

Data Type

Optional

notes

name

string

true

Descriptive name of the document. (Max allowed length 100 chars)

file_name

string

false

Do not include the file extension. (Max allowed length 100 chars)

hash

string

false

SHA-256 hash of the file contents

mime_type

string

false

MIME type for one of Supported Image Formats

document type

string

false

One of Supported Document Types

identity_type

string

false

Matching Identity Type for Document Type

description

string

true

General description of the document. (Max allowed length 255 chars)

Supported Image Formats

Image Format

Image Extension

MIME type

PNG

.png

image/png

JPG

.jpg

image/jpeg

PDF

.pdf

application/pdf

Supported Document Types

(see also /document_types)

Document Type
long-form (label)
Document Type short‑form (name)Identity Type
1040 Tax Returntax_1040other
Birth Certificatevtl_birth_certificateother
Court Order for Name Changedoc_name_changeother
Divorce Decreevtl_divorceother
Driver's permitid_drivers_permitlicense
IRS form W2tax_w2other
Lease agreementdoc_leasecontract
Marriage Certificatevtl_marriageother
Military Dependent's ID Cardid_military_dependentother
Military IDid_militaryother
Mortgage agreementdoc_mortgagecontract
NYC ID Cardid_nyc_idother
Other Documentother_docother
Other IDother_idother
Passportid_passportpassport
Pay Stub Documentationdoc_paystubother
Permanent Resident Card (or Green Card)doc_green_cardother
Social Security Administration documentation (includes 4029)doc_ssaother
Social Security Carddoc_ss_cardother
State ID cardid_stateother
State-issued driver's licenseid_drivers_licenselicense
Tax Form 1095tax_1095other
Tax Form 1099tax_1099other
Tuition Statementdoc_tuitionother
Unemployment Benefits Letterdoc_uo_benefitsother
US Passport Cardid_passport_cardpassport
Utility billdoc_utilityutility
W4 Withholding Allowance Certificatetax_W4other

Responses

Status CodesuccessDescription
200trueFile upload was successful
400falseDocument upload not permitted for users who have not started KYC
400falseUploaded file's signature does not match file_hash
400falseInvalid document_type
400falseInvalid identity_type
400falseSpecified identity_type does not support uploaded documents
400falseidentity_type and document_type mismatch
400falseUnsupported or mismatched mime_type

See Also:

Updated about a month ago


/documents


Upload supporting documentation for KYC

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.