Mark uploads complete
curl --request POST \
--url https://api.relettr.com/v1/chapters/{chapter_id}/uploads/complete \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.relettr.com/v1/chapters/{chapter_id}/uploads/complete"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.relettr.com/v1/chapters/{chapter_id}/uploads/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "ch_7Kq2mXaB3cD4eF5gH6iJ7k",
"object": "chapter",
"livemode": true,
"status": "awaiting_upload",
"series_id": "<string>",
"number": 123,
"source_language": "ko",
"target_language": "en",
"options": {
"layout": "strip",
"translate_sfx": false,
"output": {
"layout": "original",
"strip": false,
"format": "png",
"quality": 90
},
"on_mask_failure": "hold",
"auto_start": false,
"max_credits": 2
},
"uploads": [
{
"index": 123,
"method": "PUT",
"url": "<string>",
"headers": {},
"expires_at": "2023-11-07T05:31:56Z"
}
],
"quote": {
"credits": 462,
"parts": 21,
"breakdown": {
"ocr": 123,
"translate": 123,
"clean_letter": 123,
"sfx": 123
}
},
"credits": {
"held": 123,
"charged": 123,
"refunded": 123
},
"progress": {
"step": "read",
"percent": 50,
"parts_total": 123,
"parts_done": 123,
"steps": [
{
"name": "read",
"status": "pending"
}
]
},
"queue": {
"position": 123,
"estimated_start_at": "2023-11-07T05:31:56Z",
"gpu": "online"
},
"review": {
"open": 123,
"accepted": 123,
"zones": [
{
"id": "<string>",
"page": 123,
"box": [
123
],
"reason": "<string>"
}
]
},
"warnings": [
{
"code": "missing_glyphs",
"page": 123,
"region_ids": [
"<string>"
]
}
],
"error": {
"code": "invalid_image",
"message": "<string>",
"step": "<string>",
"file_index": 123
},
"result_version": 123,
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}Chapters
Mark uploads complete
Tells the server every file is uploaded. The chapter moves to
validating: the server checks and decodes each image, joins and cuts
the strip into parts, and computes the exact quote. Validation is free.
When it finishes the chapter is ready (and chapter.ready fires), or
failed with error.code = invalid_image (nothing is charged). With
auto_start and a quote within max_credits, the chapter goes
straight to queued.
POST
/
chapters
/
{chapter_id}
/
uploads
/
complete
Mark uploads complete
curl --request POST \
--url https://api.relettr.com/v1/chapters/{chapter_id}/uploads/complete \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.relettr.com/v1/chapters/{chapter_id}/uploads/complete"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.relettr.com/v1/chapters/{chapter_id}/uploads/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "ch_7Kq2mXaB3cD4eF5gH6iJ7k",
"object": "chapter",
"livemode": true,
"status": "awaiting_upload",
"series_id": "<string>",
"number": 123,
"source_language": "ko",
"target_language": "en",
"options": {
"layout": "strip",
"translate_sfx": false,
"output": {
"layout": "original",
"strip": false,
"format": "png",
"quality": 90
},
"on_mask_failure": "hold",
"auto_start": false,
"max_credits": 2
},
"uploads": [
{
"index": 123,
"method": "PUT",
"url": "<string>",
"headers": {},
"expires_at": "2023-11-07T05:31:56Z"
}
],
"quote": {
"credits": 462,
"parts": 21,
"breakdown": {
"ocr": 123,
"translate": 123,
"clean_letter": 123,
"sfx": 123
}
},
"credits": {
"held": 123,
"charged": 123,
"refunded": 123
},
"progress": {
"step": "read",
"percent": 50,
"parts_total": 123,
"parts_done": 123,
"steps": [
{
"name": "read",
"status": "pending"
}
]
},
"queue": {
"position": 123,
"estimated_start_at": "2023-11-07T05:31:56Z",
"gpu": "online"
},
"review": {
"open": 123,
"accepted": 123,
"zones": [
{
"id": "<string>",
"page": 123,
"box": [
123
],
"reason": "<string>"
}
]
},
"warnings": [
{
"code": "missing_glyphs",
"page": 123,
"region_ids": [
"<string>"
]
}
],
"error": {
"code": "invalid_image",
"message": "<string>",
"step": "<string>",
"file_index": 123
},
"result_version": 123,
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}Authorizations
Headers
Response
Accepted; the chapter is validating.