Skip to content

Record a large upload

POST
/submissions/{id}/documents/complete
curl -X POST "https://api.valjeanspecialty.com/api/agent/v1/submissions/SUBMISSION_ID/documents/complete" \
-H "Authorization: Bearer $VALJEAN_KEY" \
-H "Content-Type: application/json" \
-d '{"upload_id":"ed46fd9f-afa9-4f32-b134-5fb1abddcbdc-SOV.xlsx","file_name":"SOV.xlsx","content_type":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}'

Call after PUTting the file to its upload link. Calling it twice returns the same document with duplicate: true.

Needs a read-and-submit key and an agency with a signed broker agreement.

id
required
string format: uuid

Submission id.

Media typeapplication/json
object
upload_id
required
string
/^[0-9a-f-]{36}-[\w.\-]{1,120}$/
file_name
required
string
>= 1 characters <= 200 characters
content_type
required
string
>= 3 characters <= 120 characters
doc_type
string
/^[a-z0-9_]{2,40}$/

Example

{
"upload_id": "ed46fd9f-afa9-4f32-b134-5fb1abddcbdc-SOV.xlsx",
"file_name": "SOV.xlsx",
"content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}

OK

Media typeapplication/json
object
document_id
required
string format: uuid
file_name
required
string
doc_type
required

Detected or given document type, e.g. acord_125, loss_runs, sov, other.

string
note
string
duplicate

Only on /documents/complete when the upload was already recorded.

boolean

Example generated

{
"document_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"file_name": "example",
"doc_type": "example",
"note": "example",
"duplicate": true
}
RateLimit-Policy
string
Example
"per-key";q=120;w=60

The rate limit for this key, as an IETF RateLimit-Policy: 120 requests (q) per 60-second window (w), counted across all of Valjean’s servers. Over it, you get 429 with Retry-After.

Fix the request and send it again (invalid_request, invalid_json).

Media typeapplication/json
object
error
required
object
code
required

Machine-readable code, e.g. invalid_request, read_only, not_found, closed, rate_limited.

string
message
required

Plain-English explanation you can show a person.

string
issues

Validation problems, as “field: problem” (400 invalid_request only).

Array<string>

Example

{
"error": {
"code": "invalid_request",
"message": "Check the request.",
"issues": [
"insured.state: Too small: expected string to have >=2 characters"
]
}
}

Key or token missing, wrong, expired or revoked (unauthorized). Don’t retry: get a new key or sign in again.

Media typeapplication/json
object
error
required
object
code
required

Machine-readable code, e.g. invalid_request, read_only, not_found, closed, rate_limited.

string
message
required

Plain-English explanation you can show a person.

string
issues

Validation problems, as “field: problem” (400 invalid_request only).

Array<string>

Example

{
"error": {
"code": "unauthorized",
"message": "This API key isn't valid. Ask your Valjean broker for a new one."
}
}

Not allowed: read_only (a read key tried to submit), agency_not_active (no signed broker agreement), not_offered (instant quotes are off), forbidden (API access off for the agency). Don’t retry.

Media typeapplication/json
object
error
required
object
code
required

Machine-readable code, e.g. invalid_request, read_only, not_found, closed, rate_limited.

string
message
required

Plain-English explanation you can show a person.

string
issues

Validation problems, as “field: problem” (400 invalid_request only).

Array<string>

Example

{
"error": {
"code": "read_only",
"message": "This key can read only. Ask your Valjean broker for a key that can submit."
}
}

Not found, or not your agency’s (not_found). The API never says which.

Media typeapplication/json
object
error
required
object
code
required

Machine-readable code, e.g. invalid_request, read_only, not_found, closed, rate_limited.

string
message
required

Plain-English explanation you can show a person.

string
issues

Validation problems, as “field: problem” (400 invalid_request only).

Array<string>

Example

{
"error": {
"code": "not_found",
"message": "Submission not found."
}
}

Body or file too large (too_large): JSON bodies up to 64 KB, direct uploads 4 MB, upload links 25 MB.

Media typeapplication/json
object
error
required
object
code
required

Machine-readable code, e.g. invalid_request, read_only, not_found, closed, rate_limited.

string
message
required

Plain-English explanation you can show a person.

string
issues

Validation problems, as “field: problem” (400 invalid_request only).

Array<string>

Example

{
"error": {
"code": "too_large",
"message": "Files over 4 MB need an upload link."
}
}

File type not accepted (unsupported_type): PDF, images, Word, Excel, CSV or text.

Media typeapplication/json
object
error
required
object
code
required

Machine-readable code, e.g. invalid_request, read_only, not_found, closed, rate_limited.

string
message
required

Plain-English explanation you can show a person.

string
issues

Validation problems, as “field: problem” (400 invalid_request only).

Array<string>

Example

{
"error": {
"code": "unsupported_type",
"message": "Send PDF, image, Word, Excel, CSV or text files."
}
}

Too many requests (rate_limited): 120 a minute per key, 30 a minute per IP on public endpoints, counted across all of Valjean’s servers. Wait Retry-After seconds.

Media typeapplication/json
object
error
required
object
code
required

Machine-readable code, e.g. invalid_request, read_only, not_found, closed, rate_limited.

string
message
required

Plain-English explanation you can show a person.

string
issues

Validation problems, as “field: problem” (400 invalid_request only).

Array<string>

Example

{
"error": {
"code": "rate_limited",
"message": "Too many requests. Try again in a minute."
}
}
Retry-After
integer
Example
60

Seconds to wait.

Something went wrong on Valjean’s side (server_error). Safe to retry later; creates are idempotent with client_reference or an Idempotency-Key header.

Media typeapplication/json
object
error
required
object
code
required

Machine-readable code, e.g. invalid_request, read_only, not_found, closed, rate_limited.

string
message
required

Plain-English explanation you can show a person.

string
issues

Validation problems, as “field: problem” (400 invalid_request only).

Array<string>

Example

{
"error": {
"code": "server_error",
"message": "Something went wrong. Try again shortly."
}
}