Request
This example safely JSON-encodes a staged diff with jq. Set the access token and organization ID in your local shell without committing them.
shell
git diff --cached --unified=3 |
jq -Rs '{"diff": ., "targetLanguage": "typescript", "clientReference": "checkout-auth"}' |
curl --request POST \
"https://api.enjoyable.work/v1/organizations/$ENJOYABLE_ORGANIZATION_ID/reviews/diff/sync" \
--header "Authorization: Bearer $ENJOYABLE_ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data-binary @- Response
A successful response includes the request ID, echoed client reference, zero or more findings, and customer-relevant processing metadata.
json
{
"requestId": "123e4567-e89b-42d3-a456-426614174000",
"clientReference": "checkout-auth",
"findings": [
{
"filePath": "src/auth.ts",
"lineNumber": 12,
"lineSide": "NEW",
"oldLineNumber": null,
"hunkHeader": "@@ -8,6 +8,7 @@ export function canAccess(user) {",
"priority": "P1",
"category": "LOGIC_BUG",
"summary": "The assignment makes the authorization branch always succeed.",
"suggestedFix": "Use a strict equality comparison for the role check."
}
],
"metadata": {
"processingMs": 842,
"chunksAnalyzed": 1,
"tokenUsage": {
"promptTokens": 1124,
"completionTokens": 214,
"totalTokens": 1338,
"estimated": false
},
"warnings": []
}
} Synchronous boundary
This is not a pull-request run
The HTTP request remains open until analysis completes or fails. The published asynchronous pull-request routes are in-development placeholders; connected review execution and durable result retrieval are not available through them.