Replace a document
Changed onReplace an existing document with a new file and/or updated metadata. The request must use multipart/form-data.
Use this when a stored document was rejected during review, which arrives as an entry in the verification's errors array rather than as an error on upload. Replacing marks the previously submitted file inactive, which a second POST /documents would not do: that leaves the rejected file active alongside the new one, and the rejection can carry. Call POST /verifications afterwards to start a new review, since existing errors persist until a new review produces a new verdict.
A file rejected on upload with 422 DOCUMENT_REJECTED never creates a document, so there is nothing to replace. Retry those with POST /documents.
Supported file types: application/pdf, image/jpeg, and image/png. Grid matches on the Content-Type of the multipart part, not the file extension. Any other type, and any file over 10 MB, returns 400 INVALID_INPUT.
Grid forwards the file to its verification provider, which screens it as the request is handled and can reject it with 422 DOCUMENT_REJECTED. To pass that screen, a photo or scan of a document must:
- show the whole document, with all four corners inside the frame and nothing overlapping an edge
- be in focus and free of glare, so every field and the machine-readable zone can be read
- be in color, not a black-and-white copy
- be a photo or scan of the physical document, not a screen capture, and not retouched in an image editor
- be unexpired
Request
- Base URL: https://api.lightspark.com/grid/2025-10-13
- URL: https://api.lightspark.com/grid/2025-10-13/documents/{documentId}
- Auth: HTTP basic
Path parameters
Document ID
Response
Document replaced successfully
Example response
{
"id": "Document:019542f5-b3e7-1d02-0000-000000000001",
"documentHolder": "BeneficialOwner:019542f5-b3e7-1d02-0000-000000000001",
"documentType": "PASSPORT",
"side": "FRONT",
"country": "US",
"documentNumber": "A12345678",
"issuingAuthority": "U.S. Department of State",
"fileName": "passport_scan.pdf",
"createdAt": "2025-10-03T12:00:00Z",
"updatedAt": "2025-10-03T12:00:00Z"
}Changes
- warning
the
////request property's maxLength was set to100 - warning
the
////request property's maxLength was set to255
- warning
- breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - breaking
removed the required property
from the response with the status - warning
added the new
ACCOUNT_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
AUTH_METHOD_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
CUSTOMER_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
DOCUMENT_HOLDER_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
INSUFFICIENT_FUNDSenum value to theresponse property for the response status - warning
added the new
NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
PAYMENT_URL_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
PLATFORM_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
QUOTE_EXPIREDenum value to theresponse property for the response status - warning
added the new
QUOTE_RATE_UNAVAILABLEenum value to theresponse property for the response status - warning
added the new
REQUEST_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
SESSION_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_AMOUNT_NOT_REPRESENTABLEenum value to theresponse property for the response status - warning
added the new
STABLECOIN_BURN_SOURCE_NOT_SUPPORTEDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_EXTERNAL_ACCOUNT_LINK_FAILEDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_EXTERNAL_ACCOUNT_LINK_METHOD_REQUIREDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_EXTERNAL_ACCOUNT_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_EXTERNAL_ACCOUNT_NOT_LINKEDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_EXTERNAL_ACCOUNT_NOT_SUPPORTEDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_EXTERNAL_ACCOUNT_PROVIDER_LINK_FAILEDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_EXTERNAL_ACCOUNT_PROVIDER_LINK_REQUIREDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_GRID_OPERATIONS_NOT_ENABLEDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_NOT_PROVISIONEDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_OPERATION_NOT_FOUNDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_OPERATION_NOT_SUPPORTEDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_PROVIDER_ERRORenum value to theresponse property for the response status - warning
added the new
STABLECOIN_PROVIDER_SOURCE_NOT_LINKEDenum value to theresponse property for the response status - warning
added the new
STABLECOIN_VERIFICATION_FAILEDenum value to theresponse property for the response status - warning
added the new
VERIFICATION_NOT_FOUNDenum value to theresponse property for the response status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status
- breaking