curl --request POST \
--url https://www.gostudio.ai/api/v2/apps/watermark-remover/record \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"generation_log_id": 12345,
"status": "completed",
"output_urls": [
"https://r2.gostudio.ai/g/k7p2qm9x/i/p4w7t1.jpg"
]
}
'{
"status": 200,
"data": {
"generation_log_id": 123,
"status": "completed",
"credits_deducted": 123,
"credit_balance": 0,
"output_urls": [
"<string>"
]
}
}{
"status": 400,
"error": {
"type": "validation_error",
"code": "invalid_job_status",
"dev": 40037,
"message": "This job has already been finalized."
}
}{
"status": 401,
"error": {
"type": "authentication_error",
"code": "unauthorized",
"dev": 40100,
"message": "Missing or invalid Authorization Bearer token."
}
}{
"status": 403,
"error": {
"type": "permission_error",
"code": "forbidden",
"dev": 40300,
"message": "You don't have permission for this action."
}
}{
"status": 404,
"error": {
"type": "not_found_error",
"code": "generation_log_not_found",
"dev": 40405,
"message": "Generation log not found."
}
}{
"status": 429,
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"dev": 42900,
"message": "You're doing that too often. Please wait a moment."
}
}{
"status": 500,
"error": {
"type": "system_error",
"code": "internal_error",
"dev": 50000,
"message": "Something went wrong on our end."
}
}{
"status": 503,
"error": {
"type": "system_error",
"code": "service_unavailable",
"dev": 50300,
"message": "Auth service is temporarily unavailable."
}
}Record a generation result
Finalizes an existing generation log — stores the output URLs and marks the job completed, or marks it failed and refunds the credits that were reserved for it at submit time. Credits are deducted when the generation is submitted, not here; credits_deducted echoes the amount already charged. A job can only be finalized once; a second call returns 400 invalid_job_status. If the log carries a webhook_url in its metadata, or you pass one here, the result is delivered to it.
Allowed callers: user. An internal service token passes the auth gate but carries no user context, so the job lookup returns 404.
curl --request POST \
--url https://www.gostudio.ai/api/v2/apps/watermark-remover/record \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"generation_log_id": 12345,
"status": "completed",
"output_urls": [
"https://r2.gostudio.ai/g/k7p2qm9x/i/p4w7t1.jpg"
]
}
'{
"status": 200,
"data": {
"generation_log_id": 123,
"status": "completed",
"credits_deducted": 123,
"credit_balance": 0,
"output_urls": [
"<string>"
]
}
}{
"status": 400,
"error": {
"type": "validation_error",
"code": "invalid_job_status",
"dev": 40037,
"message": "This job has already been finalized."
}
}{
"status": 401,
"error": {
"type": "authentication_error",
"code": "unauthorized",
"dev": 40100,
"message": "Missing or invalid Authorization Bearer token."
}
}{
"status": 403,
"error": {
"type": "permission_error",
"code": "forbidden",
"dev": 40300,
"message": "You don't have permission for this action."
}
}{
"status": 404,
"error": {
"type": "not_found_error",
"code": "generation_log_not_found",
"dev": 40405,
"message": "Generation log not found."
}
}{
"status": 429,
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"dev": 42900,
"message": "You're doing that too often. Please wait a moment."
}
}{
"status": 500,
"error": {
"type": "system_error",
"code": "internal_error",
"dev": 50000,
"message": "Something went wrong on our end."
}
}{
"status": 503,
"error": {
"type": "system_error",
"code": "service_unavailable",
"dev": 50300,
"message": "Auth service is temporarily unavailable."
}
}Authorizations
Supabase user JWT (or an internal service token). Send as Authorization: Bearer <token>.
Body
The log to finalize. Must belong to the caller.
12345
completed, failed Required when status is completed; must be non-empty.
Failure reason, used when status is failed.
HTTPS URL to deliver the result to. Overrides the log's stored webhook.

