{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$ref": "#/definitions/MFASubmitResponse",
    "definitions": {
        "MFASubmitResponse": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "number",
                    "enum": [
                        200,
                        204,
                        409
                    ],
                    "description": "204 (device) or 200 (phone) for an accepted code - since iOS 26.4 the backend responds with 409, the body indicates if the code was valid"
                },
                "data": {
                    "anyOf": [
                        {
                            "type": "object",
                            "properties": {
                                "securityCode": {
                                    "type": "object",
                                    "properties": {
                                        "valid": {
                                            "type": "boolean"
                                        }
                                    },
                                    "description": "Result of the code verification (since iOS 26.4)"
                                },
                                "service_errors": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "code": {
                                                "type": "string"
                                            },
                                            "message": {
                                                "type": "string"
                                            }
                                        },
                                        "description": "A service error, as returned by the auth backend"
                                    },
                                    "description": "Errors, e.g. if the code was incorrect"
                                }
                            }
                        },
                        {
                            "type": "string",
                            "const": ""
                        }
                    ],
                    "description": "Empty for status 204"
                },
                "headers": {
                    "type": "object",
                    "properties": {
                        "x-apple-session-token": {
                            "type": "string",
                            "description": "Updated session token, provided for a valid code since iOS 26.4",
                            "minLength": 1
                        }
                    }
                }
            },
            "required": [
                "status",
                "data",
                "headers"
            ],
            "description": "The expected response format for the MFA code submission"
        }
    }
}
